Add actionlint to pre-commit; fix what it found - #2226
Merged
Conversation
actionlint statically checks the workflow files: schema, expression
contexts, workflow_call input wiring, runner labels (declared in
.github/actionlint.yaml), and shellcheck over run: scripts (gated to
errors+warnings; info/style ignored to match the shellcheck hook's
severity philosophy).
Findings fixed:
- bespoke-build-arm64: the default image "gcc" wasn't in the options
list (only heaptrack is built for arm64), so API dispatches relying
on the default named a nonexistent image.
- bespoke-build{,-arm64}: quote $(pwd)/$(basename ...) command
substitutions (SC2046).
- lin/win-lib-build: drop `default` from required workflow_call inputs
— a required input's default can never be used, so this is dead
config; no caller behaviour changes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the actionlint rollout by adding rhysd/actionlint to pre-commit, introducing a repository actionlint configuration (including recognized self-hosted runner labels and shellcheck severity filtering), and applying the resulting workflow fixes to keep GitHub Actions YAML/schema and embedded shell scripts clean.
Changes:
- Added an
actionlintpre-commit hook (v1.7.12). - Added
.github/actionlint.yamlto declare self-hosted runner labels and ignore shellcheck info/style findings in embeddedrun:scripts. - Fixed workflows based on actionlint findings (arm64 image default, quoting for command substitutions, and removal of redundant defaults on required
workflow_callinputs).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.pre-commit-config.yaml |
Adds actionlint to the pre-commit hook set to statically validate workflow files. |
.github/workflows/win-lib-build.yaml |
Removes default: from required workflow_call inputs to eliminate dead/unused configuration. |
.github/workflows/lin-lib-build.yaml |
Removes default: from required workflow_call inputs to eliminate dead/unused configuration. |
.github/workflows/bespoke-build.yaml |
Quotes command substitutions in docker run volume mount and GITHUB_OUTPUT writes to satisfy shellcheck/actionlint. |
.github/workflows/bespoke-build-arm64.yaml |
Fixes invalid image default to heaptrack and applies the same shell quoting improvements as the x64 workflow. |
.github/actionlint.yaml |
Configures actionlint with known self-hosted runner labels and shellcheck ignore patterns for info/style severities. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jul 10, 2026
This was referenced Jul 10, 2026
Merged
Merged
mattgodbolt
added a commit
to compiler-explorer/compiler-explorer
that referenced
this pull request
Jul 12, 2026
Part of the actionlint rollout across CE repos (compiler-explorer/compiler-workflows#68, compiler-explorer/infra#2226). [actionlint](https://github.com/rhysd/actionlint) statically checks workflow files: schema/typos, expression type-checking against real contexts (undefined inputs/outputs/needs are errors), unknown runner labels, and shellcheck over embedded `run:` scripts. This repo has no pre-commit framework, so it's wired as a small CI workflow that runs on any push/PR touching `.github/workflows/**`, using the pinned official docker image. `.github/actionlint.yaml` declares the self-hosted `admin` label so `runs-on: [admin]` (deploy workflows) checks correctly. The existing ten workflows already pass with no findings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Part of the actionlint rollout across CE repos (compiler-explorer/compiler-workflows#68 was first). actionlint statically checks workflow files for schema errors, expression-context mistakes (e.g. an
if:referencing an input or job output that doesn't exist),workflow_callinput wiring, unknown runner labels, and runs shellcheck over embeddedrun:scripts.Setup
rhysd/actionlintv1.7.12; pre-commit auto-provisions Go)..github/actionlint.yamldeclares our self-hosted labels (ce,small,medium,admin,lin-builder,win-builder).shellcheck --severity=errorhook policy. That silenced 20 info/style nits rather than churning working scripts.Real findings fixed
bespoke-build-arm64.yaml: latent bug — theimagechoice input defaulted togcc, which isn't in its options list (onlyheaptrackis built for arm64). Agh/API dispatch relying on the default would try to run a nonexistentcompilerexplorer/gcc-builder:latest-arm64image. Default nowheaptrack.bespoke-build{,-arm64}.yaml: quoted$(pwd)/$(basename …)command substitutions (SC2046, warning level).lin-lib-build.yaml/win-lib-build.yaml: removeddefault:from requiredworkflow_callinputs — GitHub never uses a default on a required input, so this was dead config; all existing callers pass both values explicitly and are unaffected.Pre-commit passes on all changed files.
🤖 Generated with Claude Code