continuous-integrationgithub-actionsgit-branchgit-taggit-workflow

github actions workflow workflow_dispatch running a workflow manually - most of the Tags are disabled


I am using github actions workflow for code deployment. One of the flow is manual using workflow_dispatch. I am able to select main or any feature branch but when i select tags - most of them are disabled and gives you below error message:

"Workflow does not exist or does not have a workflow_dispatch trigger in this tag. Learn more about manual workflows"

If I create a new git tag, i am able to deploy. Please help me by sharing the logic and reasoning. Thanks,


Solution

  • If workflow didn't exist when the tag was created, it's not available. The same goes for branches.

    The way to fix it is to either cherry-pick workflow there and move a tag or re-base the tag on top of the master branch.

    Also keep in mind if you modify workflow on your master branch, but you have a different version in branches - it will use the branch / tag version.

    If you want to keep 1 version across all tags - you should pass a tag as an input variable and run it on master branch instead of running workflow on this tag. Then you just have to modify your checkout-action to checkout the passed tag, not leaving it with defaults.