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

actions/shellcheck: Check GitHub Actions composite actions too #91

Merged
merged 6 commits into from
Jun 7, 2024

Conversation

tsibley
Copy link
Member

@tsibley tsibley commented Jun 6, 2024

See commit messages.

Checklist

  • Checks pass

…ocal

Avoids scope pollution; noticed when I was about to add a similar
function with a "tmpdir" variable itself.
…eps…

…in preparation for adding support for composite action files too.
Composite actions are kind of like a single job in a workflow, so we'll
use the same logic for handling them.

Diff best viewed with whitespace ignored.
…actions too

Covers an area we were previously missing.

Composite actions have steps just like a job in a workflow, so we can
treat them similarly.
… defined

By default it already assumes UPPERCASE vars are always defined
externally, but it will warn about lowercase vars that it doesn't know
about.  Resolves a warning about the use of a "runtime" env var in
actions/setup-nextstrain-cli.
@tsibley tsibley force-pushed the trs/shellcheck-actions-too branch from ad2945f to 8a0a372 Compare June 6, 2024 18:31
…ia the shebang

This lets it properly detect when modes like "errexit" (i.e. `set -e`)
and "pipefail" are enabled via the shell invocation.  Resolves a false
warning in a Nextstrain CLI action that uses `pushd` without checking
exit code (because `-e` is in the shell invocation so checking is
unnecessary).

Disables a couple of warnings that pertain to the shebang, which are
fine to ignore because we're generating it just to hint ShellCheck.
@tsibley tsibley requested a review from a team June 6, 2024 19:27
@tsibley tsibley mentioned this pull request Jun 6, 2024
1 task
@tsibley
Copy link
Member Author

tsibley commented Jun 6, 2024

Incidentally, this work also led me to identify a bug in ShellCheck's handling of shebangs: the regex used to check for -e erroneously matches -o pipefail (and other false positive strings). If I can find some time, I'll likely try to submit a patch upstream.

@tsibley tsibley merged commit baf4c03 into master Jun 7, 2024
38 checks passed
@tsibley tsibley deleted the trs/shellcheck-actions-too branch June 7, 2024 19:33
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

Successfully merging this pull request may close these issues.

2 participants