Run shellcheck on GitHub Actions run steps as part of pre-commit#624
Run shellcheck on GitHub Actions run steps as part of pre-commit#624
run steps as part of pre-commit#624Conversation
srittau
left a comment
There was a problem hiding this comment.
shellcheck is such a useful linter.
|
Currently when running Lint GitHub Actions workflow files.......................................Failed
- hook id: actionlint
- exit code: 3
fatal error while checking .github/workflows/publish.yml: `/home/XXX/.cache/pre-commit/repomaenr34r/golangenv-default/bin/shellcheck --norc -f json -x --shell bash -e SC1091,SC2194,SC2050,SC2154,SC2157,SC2043 -` did not run successfully while checking script at line:34,col:9: /home/XXX/.cache/pre-commit/repomaenr34r/golangenv-default/bin/shellcheck exited with status 1 but stdout was empty. stderr: "2025/07/07 15:34:45 module[] function[_start] failed: wasm error: out of bounds memory access\nwasm stack trace:\n\t.$50274() i32\n\t.$21()\n"@AlexWaygood do you have any idea about the cause or a fix? |
No, I have no idea, sorry :-( I can't reproduce locally
Just to check, I assume you mean what platform are you on? I'm on MacOS. |
Yes
Running on Ubuntu 22.04. |
|
A few other things you could try/check:
|
3.11.11, tried also with 3.12 now
Deleted both but didn't solve it. If I try to execute shellcheck directly I also get the error. I tried blank, /home/XXX/.cache/pre-commit/repo6mmeggte/golangenv-default/bin/shellcheck -h
2025/07/07 16:25:14 module[] function[_start] failed: wasm error: out of bounds memory access
wasm stack trace:
.$50274() i32
.$21()I assume something goes wrong during the installation, maybe an incompatible version? |
actionlint has an optional shellcheck integration which scrapes the
runsteps of GitHub workflows and passes them to shellcheck. We have some reasonably complex workflows in this repo, and shellcheck finds some issues in some of them:Shellcheck complaints regarding our GitHub workflows
This PR enables actionlint's shellcheck integration in our
.pre-commit-config.yamlfile, and fixes the complaints shellcheck has regarding our GitHub workflows. I tested locally in a shell that the new shell snippets produce the same results as before, and I tested locally thatuvx pre-commit run -astill passes on this PR branch. (Note that we don't yet run pre-commit in CI -- #607 (comment).)