workflow-dispatch icon indicating copy to clipboard operation
workflow-dispatch copied to clipboard

Error: Unable to find workflow in example/repo 😥

Open rutgerth1508 opened this issue 4 years ago • 8 comments

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?

rutgerth1508 avatar May 12 '21 09:05 rutgerth1508

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

JayyTurakhia avatar May 13 '21 20:05 JayyTurakhia

Same problem here. Workflow exists on master branch.

mvanroon avatar Oct 22 '21 16:10 mvanroon

Same here , occurred after failed runs in PR branch, but the workflow is in tact in default branch.

ipeshev avatar Jan 04 '22 08:01 ipeshev

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?

CWSites avatar Feb 22 '22 20:02 CWSites

Verified another one of my branch workflows is also broken.

CWSites avatar Mar 02 '22 15:03 CWSites

Hi! Same problem, here.

perezzini avatar May 23 '22 15:05 perezzini

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.

asafwat avatar Aug 16 '22 09:08 asafwat

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 }}     

santunioni avatar Oct 19 '22 16:10 santunioni

Closing, as v1.2 onwards you can use the filename to trigger workflows

benc-uk avatar Oct 28 '22 16:10 benc-uk

@benc-uk it doesn't work in v1.2.1

yolu-kxs avatar Dec 17 '22 00:12 yolu-kxs

@benc-uk it doesn't work in v1.2.1

1.2.1 has been superceded by the latest release 1.2.2

benc-uk avatar Dec 17 '22 08:12 benc-uk

This is still a sporadic issue on 1.2.2

bjoernw avatar Mar 22 '23 19:03 bjoernw

If it's sporadic, then the issue is probably the GitHub API That's not something I can control!

benc-uk avatar Mar 25 '23 09:03 benc-uk

Could it be an issue if my workflow filename ends with .yml rather than .yaml ?

andreagalle avatar Apr 04 '24 01:04 andreagalle