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

Playground does not catch certain Shellcheck issues #364

Open
stackptr opened this issue Oct 13, 2023 · 4 comments
Open

Playground does not catch certain Shellcheck issues #364

stackptr opened this issue Oct 13, 2023 · 4 comments

Comments

@stackptr
Copy link

With .github/workflows/test.yml:

name: Test workflow

on:
  push:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - run: |
          now="$(date +%s)"
          read -r -d '' req_json <<MALFORMED_EOF
          {
            "foo": "bar"
          }
                MALFORMED_EOF
          echo "$req_json"

Copying and pasting into the playground yields no issues in Safari or Chrome.

Running actionlint (via Nix) in CLI catches an issue with malformed here document:

shell ❯ actionlint .github/workflows/test.yml
.github/workflows/test.yml:10:9: shellcheck reported issue in this script: SC1009:info:2:1: The mentioned syntax error was in this simple command [shellcheck]
   |
10 |       - run: |
   |         ^~~~
.github/workflows/test.yml:10:9: shellcheck reported issue in this script: SC1073:error:2:24: Couldn't parse this here document. Fix to allow more checks [shellcheck]
   |
10 |       - run: |
   |         ^~~~
.github/workflows/test.yml:10:9: shellcheck reported issue in this script: SC1039:error:6:1: Remove indentation before end token (or use <<- and indent with tabs) [shellcheck]
   |
10 |       - run: |
   |         ^~~~
.github/workflows/test.yml:10:9: shellcheck reported issue in this script: SC1072:error:9:1: Here document was not correctly terminated. Fix any mentioned problems and try again [shellcheck]
   |
10 |       - run: |
   |         ^~~~

As far as I can tell, there is no configuration that actionlint is using locally that would explain these different outputs.

@sondrelg

This comment was marked as off-topic.

@rhysd
Copy link
Owner

rhysd commented Jun 24, 2024

This is a limitation of playground because shellcheck cannot run on browser. Playground runs actionlint via WASM on client side.

@sondrelg

This comment was marked as off-topic.

@rhysd

This comment was marked as off-topic.

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

3 participants