I have a GitHub Action which is set to run at will when triggered manually (with the workflow_dispatch keyword under the on secton). Apparently when I run the Action from a feature branch, it only loads the Action YML from the feature branch and loads everything else from master.
One of the Action's steps calls a PowerShell script. When run for a feature branch, it executes the script that is in master, no the script in my feature branch. If it references a script that only exists in my feature branch and not in master, then it fails and says the script does not exist.
That makes it very hard to experiment with the Action, since apparently all its dependencies need to be merged to master before I can test them.
This is how I trigger my Action:
- Go to GitHub -> Actions -> Workflows sidebar and select my workflow.
- Next to where it says "This workflow has a
workflow_dispatchevent trigger", click Run workflow. - Under Use workflow from, select my feature branch.
- Click Run workflow.
Am I doing something completely wrong here?
Here is my Action YML:
name: Deploy to persistent environment
on:
workflow_dispatch:
inputs:
deployment_target:
type: choice
description: Choose an environment to deploy to
options:
- dev
- staging
- production
jobs:
deploy-kms-to-persistent-environment:
name: Deploy KMS to ${{ github.event.inputs.deployment_target}}
runs-on: [self-hosted, 3shape-ubuntu-latest]
steps:
- name: Deploy application
working-directory: ./src/deploy/kms-bicep
shell: pwsh
run: |
./deploy-release-application2.ps1
