Repository navigation
Lint the action's run body with the pinned shellcheck - #5
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ci.ymlshellchecks the.shfiles with a digest-pinned image, buttests/lint-action.shlinted the extractedrun:body with whatevershellcheckthe 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'stests/shellcheck-composite.pyalready uses. CI setsSHELLCHECKto the same pinned image. Unset, it is plainshellcheck. 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 overcommit-branch.sh tests/*.sh,tests/run.sh(13 assertions) and actionlint also pass.Test and CI only, so no release.
Left unapplied in #4.