Skip to content

Lint the action's run body with the pinned shellcheck - #5

Merged
barnumbirr merged 1 commit into
masterfrom
lint-the-body-with-the-pinned-shellcheck
Oct 6, 2026
Merged

barnumbirr merged 1 commit into
masterfrom
lint-the-body-with-the-pinned-shellcheck

Conversation

@barnumbirr

@barnumbirr barnumbirr commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

ci.yml shellchecks the .sh files with a digest-pinned image, but tests/lint-action.sh linted the extracted run: body with whatever shellcheck the runner had, so two versions judged this repository's shell.

The script now writes the body inside the checkout (prefixed .lint-action-body., removed on exit) and takes the checker from $SHELLCHECK, the pattern action-debian-build's tests/shellcheck-composite.py already uses. CI sets SHELLCHECK to the same pinned image. Unset, it is plain shellcheck. Local runs now need write access to the checkout, where the temp file is made.

Verification, locally through the pinned container: the current body passes, and a seeded unquoted expansion in action.yml's body fails with SC2086. The working tree is clean afterwards. The image runs as root, so it can read the 0600 temp file the runner's uid creates. The pinned shellcheck over commit-branch.sh tests/*.sh, tests/run.sh (13 assertions) and actionlint also pass.

Test and CI only, so no release.

Left unapplied in #4.

ci.yml checks the .sh files with a digest-pinned shellcheck, while
tests/lint-action.sh checked the extracted run: body with whatever
shellcheck the runner had. The script now writes the body inside the
checkout and takes the checker from $SHELLCHECK, as
action-debian-build's shellcheck-composite.py does, and CI points that
at the same pinned image. Unset, it is plain shellcheck, so local runs
are unchanged.

Checked locally through the container: the current body passes, and a
seeded unquoted expansion fails with SC2086.
@barnumbirr
barnumbirr merged commit eecda89 into master Oct 6, 2026
1 check passed
@barnumbirr
barnumbirr deleted the lint-the-body-with-the-pinned-shellcheck branch October 6, 2026 20:17
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.

1 participant