Can't trigger workflow manually

I just saw this blog post. Thank you for implementing this feature.

I changed an existing workflow in a branch to have the workflow_dispatch trigger event. After I got the syntax right, I found I couldn’t see the “Run workflow” button shown in the blog. So I tried a few things to try to get it to show up, such as renaming the workflow file to “generate_license_activation.yaml” and merging it into the base branch. However, the workflow does not show up in the list, so there’s no way to check for the existence of the “Run workflow” button. The repository is private, but there’s no secret sauce to the workflow file.

.github/workflows/generate_license_activation.yaml

name: Acquire activation file
on: 
  workflow_dispatch:
    inputs:
      newUnityVersion:
        description: 'The new version number string to generate the license activation file for.'
        required: true
        
jobs:
  activation:
    name: Request manual activation file 🔑
    runs-on: ubuntu-latest
    steps:
      # Request manual activation file
      - name: Request manual activation file
        id: getManualLicenseFile
        uses: webbertakken/unity-request-manual-activation-file@v1.1
        with:
          unityVersion: ${{ github.event.inputs.newUnityVersion }}
      # Upload artifact (Unity_v20XX.X.XXXX.alf)
      - name: Expose as artifact
        uses: actions/upload-artifact@v1
        with:
          name: Unity license activation file for ${{ github.event.inputs.newUnityVersion }}
          path: ${{ steps.getManualLicenseFile.outputs.filePath }}
                              

Is there something I need to do to tell GitHub of the existence of this workflow or something?

According to your Workflows screenshot, you chose “All workflows”. Please click on the name of your workflow which with workflow_dispatch event. In your scenario, please select “Acquire activation file”
in the left workflows list. Then you will see the “Run workflow” button.

2 Likes

Hi thanks for responding, I clicked the wrong entry in my screenshot, but the “Run workflow” button doesn’t appear there.

Maybe if I rename the workflow it will show up as a new entry in the Workflows list and I can click Run workflow then. I’ll try that soon. But it seems like possibly there’s a defect where if you modify an existing workflow to be a “workflow_dispatch” triggered one, you can’t run it manually? I don’t know if this is intended.

I renamed the workflow and committed it to a branch, but it doesn’t show up anywhere in the GitHub actions UI.

Then I merged into my main branch (equivalent of master) and the name of the existing workflow changed, but there is still no “Run workflow” button

I turned off my Github Dark user style just to confirm it’s not interfering with anything, so that’s why the screenshots in this post look different.

Edit, here is my latest attempt:

I created a new file with a slightly different workflow name. I also checked my billing settings and made sure I still had capacity (so far I have 0 minutes/ storage used)

.github/workflows/new_unity_license_activation.yaml
name: Get new Unity license activation file
on:
  workflow_dispatch:
    inputs:
      newUnityVersion:
        description: 'The new version number string to generate the license activation file for.'
        required: true

jobs:
  activation:
    name: Request manual activation file
    runs-on: ubuntu-latest
    steps:
      # Request manual activation file
      - name: Request manual activation file
        id: getManualLicenseFile
        uses: webbertakken/unity-request-manual-activation-file@v1.1
        with:
          unityVersion: ${{ github.event.inputs.newUnityVersion }}
      # Upload artifact (Unity_v20XX.X.XXXX.alf)
      - name: Expose as artifact
        uses: actions/upload-artifact@v1
        with:
          name: Unity license activation file for ${{ github.event.inputs.newUnityVersion }}
          path: ${{ steps.getManualLicenseFile.outputs.filePath }}
                              

So I guess it isn’t the fact that the workflow existed with a different trigger before, since this is a new file… is there something wrong with the syntax of my workflow that GitHub is not telling me? Do I have to opt in to something for the button to show up?


Another edit: made a simple build to eliminate any problems with the actions libraries I’m using.

.github/workflows/test_manual.yaml
name: Test manual action run
on:
  workflow_dispatch:
    inputs:
      puppy:
        description: 'A kind of puppy.'
        required: true

jobs:
  activation:
    name: Print the input
    runs-on: ubuntu-latest
    steps:
      # Request manual activation file
      - name: Print puppy type
        id: printPuppyType
        run: echo The puppy is ${{ github.event.inputs.puppy }}
        

Still no button

Hopefully it’s something simple I’m doing wrong

I tried your examples in my side, the workflow_dispatch event is recognized in Actions tab.


My default branch is master . And I created a new workflow with your snippet on master .
What’s your default branch? Please make sure the workflow yaml file on default branch has on: workflow_dispatch event.

Yup, my default branch is “dev”, and the workflow code I posted is in “dev”. No “run workflow” button

I created a public minimal reproduction. https://github.com/dogboydog/manual-workflow-test

The “Run workflow” button is still not there. If there is something wrong with the syntax of the action, GitHub should ideally show some indication of that. Anything else to try?

Thank you for the repro. There seems to be a character in front of the name:
image

Could you try to merge this PR https://github.com/dogboydog/manual-workflow-test/pull/1 and then try again?

2 Likes

And yes, that seems to be a bug in our parser, we should report that error. I’ll file an issue for us to take a look :bowing_man:‍♂

2 Likes

Ah! Right on. That did it. Thank you!

image
image

1 Like

I’ve got a similar problem after trying to enable workflow_dispatch here:

name: Build
on:
  push:
    branches:
      - "**"
      - "!dependabot/**"
  pull_request:
    branches:
      - master
  workflow_dispatch:

I don’t require any input parameters and the run workflow button doesn’t appear. :confused:

I have the same problem in my repo (private one) where I have several workflows where I added the new workflow_dispatch event. When I click on any of them I see no “Run workflow” button. The syntax in those workflows files seems to be correct but I do no see any button. Moreover in the “Filter workflows” field the workflow_dispatch event does not shows up as pull_request or push do when I want to filter by event.

1 Like

I don’t have permissions to your repo so it wouldn’t show up for me but I’ve forked the repo and it shows up just fine:

Are you on this view?

I am experiencing a similar problem. Concerning new Repos everything works great, all of the event combos. But for existing repositories, the workflow_dispatch does not show up. It is callable via API though.

Here is a link to a sandbox repo showing this problem - https://github.com/munderseth/my.dispatch/actions. Refer to the myworkflow workflow. The Template workflow is new and works fine.

I also forked the repo mentioned above - https://github.com/munderseth/cake-docker/actions. The workflow is not displayed.

1 Like

Yes, from that view I do not see the button:

@gitfool @munderseth Thanks for reporting this. We’ve identified the issue and are going to fix it soon.

1 Like

@cschleiden I guess I might have the same issue but you couldn’t check because I am using a private repo and (even) did not leave the link to the repo. Is there any way you can check what’s going on in my repo? Thanks.

The fix has now been deployed.

1 Like

Hi @cschleiden thanks for the fix. I have confirmed it works for me concerning the repo I shared.

But I have another private repo using multiple workflows. On a branch, I added the workflow_dispatch, along with the push event. I have not changed this branch for a few days. The UI does not display the workflow_dispatch. Let me know if you would like me to provide more info or try something.

name: tests 
on:
  push:
  workflow_dispatch:
jobs:
  project1:
    runs-on: ubuntu-latest
    steps:

The workflow needs to be in the default branch: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#manually-running-a-workflow