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

actionlint returns fatal error on run: script with broken Python code #411

Closed
rhysd opened this issue Apr 10, 2024 · 0 comments
Closed

actionlint returns fatal error on run: script with broken Python code #411

rhysd opened this issue Apr 10, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@rhysd
Copy link
Owner

rhysd commented Apr 10, 2024

Repro

on: push
jobs:
  step-level:
    runs-on: ubuntu-latest
    steps:
      - run: print(
        shell: python

Install pyflakes and run actionlint for the workflow:

actionlint test.yaml

Expected behavior

The syntax error in run: script should be printed as a lint error reported from actionlint:

test.yaml:6:9: pyflakes reported issue in this script: 1:7: unexpected EOF while parsing [pyflakes]
   |
10 |       - run: print(
   |         ^~~~

Actual behavior

actionlint reports a fatal error instead:

`/path/to/pyflakes` did not run successfully while checking script at line:6,col:9: /path/to/pyflakes.exe exited with status 1 but stdout was empty. stderr: "<stdin>:1:7: unexpected EOF while parsing\r\nprint(\r\n      ^\r\n"

Other information

This is because pyflakes usually reports the lint errors to stdout, but it reports syntax errors to stderr. In addition, the syntax errors are reported with multiple lines but actionlint assumes that every error from pyflakes is reported in a single line. The error output parser needs to be updated as well.

> echo 'print(' | pyflakes
<stdin>:1:7: unexpected EOF while parsing
print(
      ^
@rhysd rhysd added the bug Something isn't working label Apr 10, 2024
@rhysd rhysd self-assigned this Apr 10, 2024
@rhysd rhysd closed this as completed in 59569c8 Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant