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

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

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 39
  • Comments: 15

Commits related to this issue

Most upvoted comments

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.

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

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.

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…

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

@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

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!.

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)

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

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