[go-fan] Go Module Review: actionlint #23654
Closed
Replies: 1 comment
-
|
This discussion has been marked as outdated by Go Fan. A newer discussion is available at Discussion #23848. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🐹 Go Fan Report: rhysd/actionlint
Module:
github.com/rhysd/actionlint· Version in use:v1.7.11· Latest:v1.7.12(released 2026-03-30, yesterday!)Module Overview
actionlint is a static checker for GitHub Actions workflow files with 40+ checks covering syntax, expressions, runner labels, permissions, secrets, context availability, shellcheck/pyflakes integration, and more. It exposes both a CLI binary and a Go API, and produces structured JSON output for machine-readable parsing.
Current Usage in gh-aw
tools.go//go:build toolsto pin CLI binary ingo.modpkg/cli/actionlint.gopkg/cli/docker_images.goActionlintImage = "rhysd/actionlint:latest"constantpkg/workflow/glob_validation.goglob.gofrom actionlint v1.7.11docker run rhysd/actionlint:latest -format '\{\{json .}}')actionlintErrorstruct (message, filepath, line, column, kind, snippet, end_column)The module is used in two distinct ways: as a Docker-executed CLI for live linting, and as a vendored Go snippet (
glob_validation.go) for lightweight glob pattern validation that avoids importing the full package.Research Findings
Recent Updates
v1.7.12 (released yesterday, 2026-03-30) — the project is one version behind:
on.schedule.cron.timezone— catches invalid timezone strings in scheduled workflowsjobs.<job_name>.environment.deploymentconfigurationmacos-26-intelrunner label supportv1.7.11 (current) added:
case()expression function supportmacos-26-large/windows-2025-vs2026runner labels./path filter prefix as error (reflected inglob_validation.govendored copy)Best Practices from Maintainers
-format '\{\{json .}}'for machine-readable output (✅ already done)github.com/rhysd/actionlintpackage) can be used programmatically to avoid Docker entirelyImprovement Opportunities
🏃 Quick Wins
1. Use the
ActionlintImageconstant (low effort, high consistency)docker_images.goalready defines:Gains timezone validation,
macos-26-intellabel support, and webhook table fixes. After upgrading, update the version reference comment inpkg/workflow/glob_validation.go(line 4 referencesv1.7.11/glob.go).✨ Feature Opportunities
3. Use
EndColumnfor richer error displayThe
actionlintErrorstruct parsesEndColumnfrom the JSON output, but it's never used:console.FormatErrorcould use it to draw an underline spanning the full error range (fromColumntoEndColumn) rather than just the start position — giving much clearer visual highlighting for multi-token errors.4. Leverage v1.7.12's timezone checks
No code change needed — just upgrading the dependency means
on.scheduleworkflows with invalidtimezone:values will now be caught. Worth calling out in release notes / changelog.📐 Best Practice Alignment
5. Pin the Docker image to a specific version
Using
:latestmeans the Docker image can silently change between runs when a new actionlint version is published. This breaks reproducibility — the same workflow file could produce different errors on different days.Recommended approach: derive the pinned tag from
go.modat build time or set a version constant:Since v1.7.11, actionlint publishes signed artifact attestations, making version pinning even more valuable for supply-chain security.
6. Context propagation in
getActionlintVersion()getActionlintVersion()creates its owncontext.WithTimeout(context.Background(), 30*time.Second)rather than accepting a context from the caller. If the parent operation is cancelled (e.g., user Ctrl-C), the version check continues independently. Threading the parent context through would make cancellation work end-to-end.🔧 General Improvements
7. Track glob_validation.go drift from upstream
glob_validation.gois a vendored copy of actionlint'sglob.gopinned at v1.7.11. Any upstream bug fixes to glob validation require manual re-copy. The comment at the top provides attribution (good!), but there's no automated check to catch drift. Adding a note to the upgrade checklist or a simple comparison test would help ensure the vendored copy stays in sync after each actionlint upgrade.Recommendations
ActionlintImageconstant inactionlint.goinstead of 4 hardcoded stringsgetActionlintVersion()EndColumnin error display for better visual underlinesglob_validation.goto the upgrade runbookNext Steps
go get github.com/rhysd/actionlint@v1.7.12and update theglob_validation.goversion commentActionlintImageto"rhysd/actionlint:1.7.12"for build reproducibility"rhysd/actionlint:latest"strings inactionlint.gowithActionlintImageModule summary saved to:
scratchpad/mods/actionlint.mdSelected via round-robin (most recently updated, not reviewed in last 7 days) — §23785679887
References:
Beta Was this translation helpful? Give feedback.
All reactions