[go: up one dir, main page]

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

Better reporting when the action.yml does not exist #1718

Open
dekimsey opened this issue Apr 7, 2023 · 3 comments
Open

Better reporting when the action.yml does not exist #1718

dekimsey opened this issue Apr 7, 2023 · 3 comments
Labels
backlog Those issues are on the roadmap kind/feature-request New feature or request

Comments

@dekimsey
Copy link
dekimsey commented Apr 7, 2023

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.

@dekimsey dekimsey added the kind/feature-request New feature or request label Apr 7, 2023
@keithmgould
Copy link

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?

@dekimsey
Copy link
Author

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

@keithmgould
Copy link

That solved!! Thank you!

@ChristopherHX ChristopherHX added the backlog Those issues are on the roadmap label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Those issues are on the roadmap kind/feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants