Can't trigger workflow manually

Hi!
I have the same problem as well.
I try to setup workflow_dispatch event to launch several workflows from GitHub UI.
My final goal to setup it for release-branch.yml, rust-nightly.yml and rust-release.yml workflows in https://github.com/intellij-rust/intellij-rust repository.
To avoid unexpected errors in original repo I tried to make the corresponding changes in my own fork (Enable local and third party Actions for this repository option in Actions permissions settings is enabled)

The current result:

  • The corresponding UI is shown only for release-branch.yml workflow
  • It isn’t shown for rust-release.yml and the name of workflow was changed from rust release to workflow file path
  • item for rust-nightly.yml workflow disappeared at all. Note, it happened after workflow file renaming (and it’s probably the separate bug but anyway). Before this renaming, result was the same as for rust-release.yml workflow.

It would be great to know what’s wrong with my changes and why it works in one case and doesn’t work in others

@cschleiden The issue still happens in my private repo. Is the fix only deployed for public repositories? Thanks.

From my observations in order to see GitHub UI changes you need to have the workflow_dispatch workflow confguration merged into your main branch.

The changes related to workflow_dispatch on a branch, are only visible before the merge via the REST API.

1 Like

@cschleiden Managed to fix my issue where I was not seeing the “Run workflow” button in my workflow_dispatch event workflows. This might be an issue with the parser you guys have for these files. I have 3 different workflows files (one for pull_request events, one for push events and one for workflow_dispatch events) where the same workflow name is used in these workflows files. I see no issue with having two (for pull_request and for push events) different workflow files with the same name. The workflow file for the workflow_dispatch event had the same name and I guess this caused to not see the ‘Run workflow’ button. After given a different name to the workflow_dispatch event workflow I see the ‘Run workflow’ button. I hope I explained myself clearly. Let me know if you are interested on having more info. Thanks.

I really like the workflow_dispatch concept, but I am having more problems with the workflow_dispatch step. There must be some issue with my yaml file…

First it told me I had a syntax error (no other info) in my comments (?)

Then I removed the comments and I started getting this error instead.


For this code (there are steps afterwards but they are copy pasted from another working job)

name: Single Build and Store

on:
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log level'
        required: true
        default: 'warning'
        
defaults:
  run:
    shell: bash

Edit: check later post for solution

@cschleiden Any ideas?

Also, I have been manually setting the INPUT_INPUTNAMEHERE variables with ::set-env because they don’t seem to be set by GitHub. Is this intended?

The blog post says you define them the same way as action inputs, but it doesn’t explicitly say that the environmental variables will be set.

The documentation describes the format of the env variables:
https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs

You can see the env variable is not set in this run.

I can’t reproduce the parsing error from my private repo even by copy pasting the file contents. Not sure what’s up there. I’m adding back my real workflow to my private repo piece by piece to see if I can pinpoint where it starts failing to parse


Edit: Okay, I got it to happen again. I pasted in my intended input definition, committed and pushed, then my action started failing to parse again with " No event triggers defined in on``"

I uploaded the patch that brought the error back.

I can see a weird character in the patch, but I don’t see it in Notepad++ with all symbols turned on. It could be my editor (JetBrains Rider) inserting the characters but this is pretty confusing.

I appreciate all the work the team has done on GitHub actions. I’m not trying to complain too much. It’s just a bit frustrating to hit these kinds of walls is all, but it’s all in the life of a coder. Maybe I should try to use a different editor for now but I can’t even see this character.

Edit 2:
I found a tool that purports to identify characters:
https://www.babelstone.co.uk/Unicode/whatisit.html

When I paste in the character from the patch, it tells me this. I don’t know how reliable it is. I will look into stripping out BOM characters from files and see if that fixes the issue.

U+FEFF : ZERO WIDTH NO-BREAK SPACE [ZWNBSP] (alias BYTE ORDER MARK [BOM])

Edit 3: I have solved the BOM issue for now with a workaround. If you have the same problem, see this https://github.com/dogboydog/manual-workflow-test/blob/4df0905158c05b895a58174cc2b9779fe8dc0a89/pre-commit_sanitize_workflow.sh and copy it into .git/hooks/pre-commit if you don’t already have one. I appreciate all the help so far. After I installed this into my project I’m able to continue editing my workflows. I reported the BOM issue through the Feedback form.

I’m still curious if workflow_dispatch inputs are supposed to generate env variables or not, but it’s easy enough to set them myself in a step at the beginning of a job. Thank you!

The fix has now been deployed.

… but I still don’t see the option in the ui, although I can manually trigger the build using the api!? :confounded:

@gitfool could you check again in that repository?

@cschleiden I see it now. Thanks! What changed?

1 Like

Unfortunately that repository was hitting an issue with how we keep track of workflows internally.

Renaming the workflow would’ve helped as a work-around, but I’ve also rolled out a partial fix for now while we take a deeper look.

1 Like

@cschleiden I’m also unable to enable the workflow_dispatch UI feature on this workflow: https://github.com/informalsystems/apalache-tests/actions?query=workflow%3A"Run+Benchmarks" I’ve tried changing the name of the workflow and the name of the file its in, and none of it has seemed to help. Any chance we could be hitting the same bug?

Hello @shonfeder ,

The workflow file doesn’t appear to be in the default branch, please see https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#manually-running-a-workflow

Oh that explains it! I had missed that in the documentation. Thank you for the quick diagnosis and I’m sorry for the needless ping :slight_smile:

I am facing a similar issue with private repository

In order to make workflow action visible, I have to get it triggered once by the push or something automatic, then revert the commit for auto triggers and have only manual triggers, then only the button appears to trigger it manually.

Let me know if I should provide any specific details. The branch is default branch, but to reproduce it, if any yaml file has only workflow action in private repo it just doesn’t appear.

This is the way I am using it.

on:
  workflow_dispatch:
    inputs:
      environment:
        description: 'Environment to deploy on'     
        required: true
        default: "dev"
      action:
        description: 'Terraform Action to perform'     
        required: true
        default: "autoapply"
      extraArgs:
        description: 'Extra Args for tf command'
        required: false

Any help would be appreciated, thanks in advance.

Hey @cschleiden,
Could you guys please add that information in this documentation page as well -

(OR - Consider supporting other branches rather than the “default” one for manual triggering, it would help a lot :slight_smile: )

Hi @cschleiden, I am also having the same issue on my private repo, the workflow with workflow_dispatch does not show up. The same workflow but on a public repo works just fine

In case it helps someone, it worked after changed the file name! It seems that it is a bug with previous file names with the same name.

@cschleiden just FYI we had this bug too and had to rename the file.

In our case, we force pushed the git history back in time to where the file no longer existed, then merged a PR to add it back in. After this happened, the workflow never appeared in the UI (even after I forked the repo!) It was only after renaming the file it started showing up.

@cschleiden

I can confirm, that renaming the file does the trick. And I can also confirm, that this happens if you rebase/force push.

I have exactly the same issue. Please fix this.