Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/data/workflow_dir/_actions/actions/checkout/v2.4.0'. #692

Open
imam opened this issue Feb 10, 2022 · 15 comments

Comments

@imam
Copy link

imam commented Feb 10, 2022

Hi,

For some reason since yesterday, whenever Github Action ran, they'll failed on the first attempt, but will always succeed on the second attempt.

The error message:

Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/data/workflow_dir/_actions/actions/checkout/v2.4.0'. Did you forget to run actions/checkout before running your local action?

Would be lovely if anyone can help, thanks! :)

image

image

@imam
Copy link
Author

imam commented Feb 10, 2022

Additional notes:

I've tried to downgrade the actions/checkout to 2.3.x and 2.2.x, same error messages occured

@homeaidepi
Copy link

Any word on this. Lots of people including me are seeing this on post run. My issue stems from what I believe is I connect via checkout@v2 or v3 to a different repo then the action is running under and if I remove the blocks for that everything works so some wires get crossed when you are on a repo in the main action that kicks off the workflow but then inside that workflow you use a different repo and wires get crossed on Post Run, but everything worked in run. Weird: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' Its such a dumb error cause if the action wasnt there it could have never run. Like how the heck CANT a post run find an action that the main run just executed from...

@homeaidepi
Copy link

homeaidepi commented Apr 28, 2022

Talking out my problem gave me some inspiration. Finally a breakthrough. So I just added this to the end of my action
# Checkout the repo - uses: actions/checkout@v3 with: # Repository name with owner. For example, actions/checkout Default: ${{ github.repository }}
So Post Run needs to get connected back with this running actions repo and not whatever repo you connect to perform some external operation. Silly I need to remind the Action what its repo is, (by rechecking out to "this" or "local scope") but whatever, I got it and hope it helps someone.

@inlet
Copy link

inlet commented May 5, 2022

I'm experiencing the same in combination with:

- name: Upload result to GitHub Code Scanning
  uses: github/codeql-action/upload-sarif@v1
  with:
    sarif_file: snyk.sarif

@kaleidawave
Copy link

Was having the same problem. Looks like it only currently supports it as a whole job rather than in a step. https://github.community/t/actions-reusable-workflow-failing-to-find-action-yml-that-does-exist/231258/3

@DmitriiKalashnik
Copy link

multi-checkout-action

checkout@v2 should be the first one

- uses: actions/checkout@v2
- name: Checkout private actions
  uses: vweevers/multi-checkout-action@v1
  with:
    token: ${{ secrets.GITHUB_MACHINE_TOKEN }}
    repositories: my-org/example-action my-org/another-action@v3.1.0 my-org/third-action

@kerryj89
Copy link

Was having the same problem. Looks like it only currently supports it as a whole job rather than in a step. https://github.community/t/actions-reusable-workflow-failing-to-find-action-yml-that-does-exist/231258/3

I wish GitHub would keep topics from being deleted (I'm trying to set up my CI and already ran into a handful of dead community links), thankfully the Internet Archive has a copy https://web.archive.org/web/20220427182405/https://github.community/t/actions-reusable-workflow-failing-to-find-action-yml-that-does-exist/231258/3

@webblocksapp
Copy link

webblocksapp commented Sep 27, 2022

Was having the same problem. Looks like it only currently supports it as a whole job rather than in a step. https://github.community/t/actions-reusable-workflow-failing-to-find-action-yml-that-does-exist/231258/3

I wish GitHub would keep topics from being deleted (I'm trying to set up my CI and already ran into a handful of dead community links), thankfully the Internet Archive has a copy https://web.archive.org/web/20220427182405/https://github.community/t/actions-reusable-workflow-failing-to-find-action-yml-that-does-exist/231258/3

You are confusing workflows with actions, if you define

  • uses inside the steps block is for calling an action (a block of steps)
  • uses outside the steps block is for calling a workflow.

@maitrungduc1410
Copy link

it took me hours of to figure out this, thanks @homeaidepi for pointing it out.

In my case I have my composite action, inside the action I checkout to another repo. And it keeps on showing Post Run failed for the action. Then I realized that I need to checkout again to my main repo again (origin repo, where workflow triggered)

@Sophie1142
Copy link

@maitrungduc1410 and @homeaidepi THANK YOU for your comments--this worked for me!!!

To reiterate for future readers deep in the rabbit of debugging: in the context of calling a local action ("local" meaning in the same repo as the workflow calling the action, and "action" meaning a composite action, which is different from a reusable workflow), if that action checks out other repos, the runner fails to clean up the original workspace that triggered the workflow. That's because during clean-up, the runner's in the repo the action checked out, so it can no longer find the action file. A workaround to this is to check out the original repo again so that now the runner can clean up the local action.

Failed run:
Notice how the action and post-action `Update Zephyrus' succeeded; it's the original job clean up that failed.
image

Successful run:
image

@kumarsachin1990
Copy link

kumarsachin1990 commented Apr 13, 2023

What is the exact solution team i am getting the same error @Sophie1142

@stevenosse
Copy link

What worked for me was to remove the Checkout step from the local action

@nploi
Copy link

nploi commented Apr 19, 2023

Hi, I have another solution don't need re-checkout origin source using path of checkout@v3 action and working-directory keyword for run steps.

for ex:

- name: Checkout tools repo
  uses: actions/checkout@v3
  with:
    repository: my-org/my-tools
    path: my-tools

- name: Install Dependencies
  working-directory: my-tools
  shell: bash
  run: npm install

- name: do something else
  shell: bash
  working-directory: my-tools
  run: |
    date > generated.txt
    git config user.name github-actions
    git config user.email github-actions@github.com
    git add .
    git commit -m "generated"
    git push

Hope it helps you guys!.

fumikito added a commit to kuno1/ga-communicator that referenced this issue Jul 19, 2023
willianantunes added a commit to willianantunes/reusable-workflows that referenced this issue Sep 12, 2023
willianantunes added a commit to willianantunes/reusable-workflows that referenced this issue Sep 12, 2023
willianantunes added a commit to willianantunes/reusable-workflows that referenced this issue Sep 12, 2023
willianantunes added a commit to willianantunes/reusable-workflows that referenced this issue Sep 12, 2023
willianantunes added a commit to willianantunes/reusable-workflows that referenced this issue Sep 12, 2023
strange-corner pushed a commit to strange-corner/CircularBidirectionalFilereaderBuffer that referenced this issue Feb 2, 2024
calling a workflow instead of an action
Testfile dem Projekt hinzugefügt mit der Eigenschaft: Copy
@bobbyg603
Copy link

For us, the solution was found here https://github.com/orgs/community/discussions/26245#discussioncomment-5962450

msayson added a commit to msayson/smithy-gh-pages-action that referenced this issue May 26, 2024
At the end of the GitHub Action, checkout the original
package to return the scope to enable subsequent actions.

Prior to this change, the Post Run of integ tests failed
after successfully deploying GitHub Pages, with an error
`Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under
'/home/runner/work/smithy-gh-pages-action/smithy-gh-pages-action'. Did
you forget to run actions/checkout before running your local action?`

Ref: actions/checkout#692 (comment)
benjaminParisel added a commit to bonitasoft/bonita-documentation-site that referenced this issue Jun 5, 2024
Add a workaround to make it work when the workflow is called from
another repository.

### Notes 

Workaround found in
actions/checkout#692 (comment)
Tested in bonitasoft/bonita-labs-doc#160
@kurobaaka
Copy link

I also encountered the same problem, how to solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests