ci: lint workflow files with actionlint - #234
Merged
Merged
Conversation
A pull request only runs ci.yml and codeql.yml. Nothing reads release.yml or docker-publish.yml until they run for real on a tag or a push to main, which is how a broken release gate would reach main with every check green. This adds the one job that parses all five workflows on every pull request. Verified against deliberate regressions: it catches an undefined step id and malformed expression syntax, and shellcheck is preinstalled on the runner so it also covers the shell in every run: block. It does not validate inputs or outputs of third party actions, so it would not have caught the changesets v2 output rename in #233. This narrows the gap rather than closing it. actionlint is pinned by version and sha256 rather than installed through the upstream download script, which pipes an unpinned ref into bash. Dependabot tracks neither that script nor a docker:// reference, so the pair is bumped by hand and the checksum makes a swapped artifact fail loudly.
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.
Adds a
Lint workflowsjob toci.ymlthat runs actionlint over all five workflow files on every pull request.Why
A pull request only runs
ci.ymlandcodeql.yml.release.ymlanddocker-publish.ymlare not read by anything until they run for real, on a tag push or a push tomain. That is how a broken release gate reachesmainwith every check green, which is exactly what #200 would have done. This is the one check that parses those two files while they can still be fixed cheaply.What it does and does not catch
Measured against deliberate regressions rather than assumed:
property "typo_id" is not defined in object type ...[unexpected end of input while parsing closing bracketfetch-dept)Worth being plain about the last row: actionlint types a step's
outputsas{string => string}, so any output name passes and this would not have caught the bug that motivated it. It narrows the gap rather than closing it. What it does cover is workflow schema, expression syntax, context andneeds:references, runner labels, and, because shellcheck is preinstalled on the runner, the shell in everyrun:block.Install method
Pinned by version and sha256:
Upstream recommends
bash <(curl .../main/scripts/download-actionlint.bash), which pipes an unpinned mutable ref into bash. That is not a reasonable thing to run in the CI of an auth server that signs its own images. A third-party wrapper action would be Dependabot-trackable but adds another actor to the supply chain, anduses: docker://is explicitly not tracked by Dependabot either, so the tracking argument does not survive.The tradeoff is that neither form is Dependabot-tracked, so the version and checksum are bumped by hand. The checksum is the point: a swapped artifact fails the job loudly instead of executing.
Verification
ubuntu:24.04with shellcheck present: checksumOK, lint exit0