workflow-dispatch
workflow-dispatch copied to clipboard
Error: Unable to find workflow in example/repo 😥
I am getting an error trying to run a different workflow from the current one. This is the step in the workflow:
- name: Invoke unit test workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Unittests
token: ${{ secrets.ACCESS_TOKEN }}
And this the Unittests workflow meta data:
name: Unittests
on: [workflow_dispatch]
jobs:
build-test:
runs-on: ubuntu-latest
steps:
...
But when I try and run the first workflow I'll get the following output:
Run benc-uk/workflow-dispatch@v1
with:
workflow: Unittests
token: ***
Error: Unable to find workflow 'Unittests' in example/repo 😥
Does anyone know a solution for this problem?
Can you please confirm if the workflow file containing Unittests is on master/main/default branch of the repo. Refer - https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run
Same problem here. Workflow exists on master branch.
Same here , occurred after failed runs in PR branch, but the workflow is in tact in default branch.
Just had this crop up on me as well. Not sure what changed? I believe my primary setup is working fine but I copy/pasted the command to another workflow and it isn't having it?
Verified another one of my branch workflows is also broken.
Hi! Same problem, here.
i had the same issue, after checking this comment
https://github.com/benc-uk/workflow-dispatch/issues/1#issuecomment-657763660
it turn out that for some reason the workflow name started with a small letter when i queried github api, although the name started with a capital letter in my workflow file, so i deleted the workflow from master and add it back again and this time i got the correct name from github api and the invoke action worked.
worth to check, it could be the case.
Using the filename is a more stable solution. Can you change in your side? Example:
- name: Invoke unit test workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: unittests.yaml
token: ${{ secrets.ACCESS_TOKEN }}
Closing, as v1.2 onwards you can use the filename to trigger workflows
@benc-uk it doesn't work in v1.2.1
@benc-uk it doesn't work in v1.2.1
1.2.1 has been superceded by the latest release 1.2.2
This is still a sporadic issue on 1.2.2
If it's sporadic, then the issue is probably the GitHub API That's not something I can control!
Could it be an issue if my workflow filename ends with .yml rather than .yaml ?