[GH-ISSUE #1718] Better reporting when the action.yml does not exist #846

Open
opened 2026-03-01 21:46:51 +03:00 by kerem · 3 comments
Owner

Originally created by @dekimsey on GitHub (Apr 7, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1718

Act version

0.2.43

Feature description

If the user's test workflow tries to use the repository root as an action, it can fail with an opaque error message, 'file not found'. The root cause is a user error and not an application one, it'd just be nice to make that more clear to the user if possible.

Given a workflow like such:

name: test action
on: [push]

jobs:
  test--handling:
    runs-on: ubuntu-latest
    steps:
     - uses: ./
        with:
          hello: world

The following output is emitted

$ act
[test action/test--handling] 🚀  Start image=catthehacker/ubuntu:act-latest
[test action/test--handling]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[test action/test--handling]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[test action/test--handling]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[test action/test--handling] ⭐ Run Main ./
[test action/test--handling]   ❌  Failure - Main ./
[test action/test--handling] file does not exist
[test action/test--handling] 🏁  Job failed
Error: Job 'test--handling' failed

The same action when uploaded to GitHub returns a more actionable error message:

Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/action-test/action-test'. Did you forget to run actions/checkout before running your local action?

This is a user error, as the local action must first be checked out to do the test.

Originally created by @dekimsey on GitHub (Apr 7, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1718 ### Act version 0.2.43 ### Feature description If the user's test workflow tries to use the repository root as an action, it can fail with an opaque error message, 'file not found'. The root cause is a user error and not an application one, it'd just be nice to make that more clear to the user if possible. Given a workflow like such: ``` name: test action on: [push] jobs: test--handling: runs-on: ubuntu-latest steps: - uses: ./ with: hello: world ``` The following output is emitted ``` $ act [test action/test--handling] 🚀 Start image=catthehacker/ubuntu:act-latest [test action/test--handling] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true [test action/test--handling] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [test action/test--handling] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [test action/test--handling] ⭐ Run Main ./ [test action/test--handling] ❌ Failure - Main ./ [test action/test--handling] file does not exist [test action/test--handling] 🏁 Job failed Error: Job 'test--handling' failed ``` The same action when uploaded to GitHub returns a more actionable error message: ``` Error: Can't find 'action.yml', 'action.yaml' or 'Dockerfile' under '/home/runner/work/action-test/action-test'. Did you forget to run actions/checkout before running your local action? ``` This is a user error, as the local action must first be checked out to do the test.
Author
Owner

@keithmgould commented on GitHub (Apr 13, 2023):

I'm receiving this error, prob for the reason mentioned above, but I don't know what the fix is. I also have the action.yml in the root of the repo, and the line uses: ./, but my understanding is that is the correct path. I get that it is user error but I can't tell what my error is?

<!-- gh-comment-id:1507563949 --> @keithmgould commented on GitHub (Apr 13, 2023): I'm receiving this error, prob for the reason mentioned above, but I don't know what the fix is. I also have the `action.yml` in the root of the repo, and the line `uses: ./`, but my understanding is that is the correct path. I get that it is user error but I can't tell what my error is?
Author
Owner

@dekimsey commented on GitHub (Apr 13, 2023):

D'oh, sorry about that @keithmgould. Add a local checkout like this:

jobs:
  test--handling:
    runs-on: ubuntu-latest
    steps:
     - uses: actions/checkout@v3
     - uses: ./
        # ... remainder of test
<!-- gh-comment-id:1507571099 --> @dekimsey commented on GitHub (Apr 13, 2023): D'oh, sorry about that @keithmgould. Add a local checkout like this: ``` jobs: test--handling: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: ./ # ... remainder of test ```
Author
Owner

@keithmgould commented on GitHub (Apr 13, 2023):

That solved!! Thank you!

<!-- gh-comment-id:1507598259 --> @keithmgould commented on GitHub (Apr 13, 2023): That solved!! Thank you!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#846
No description provided.