Skip to content

refactor(validate-go): use the official golang/govulncheck-action#273

Merged
devantler merged 1 commit into
mainfrom
claude/govulncheck-official-action
Jun 1, 2026
Merged

refactor(validate-go): use the official golang/govulncheck-action#273
devantler merged 1 commit into
mainfrom
claude/govulncheck-official-action

Conversation

@devantler
Copy link
Copy Markdown
Contributor

Migrates the Go vulnerability gate from a hand-rolled implementation to the official action, per maintainer direction.

What

Replaces the custom govulncheck step in validate-go-project.yaml with the official golang/govulncheck-action@v1.0.4 (pinned by SHA b625fbe).

  • Before: actions/setup-go + go install golang.org/x/vuln/cmd/govulncheck@v1.3.0 + a ~60-line custom JSON-mode scan with a .govulncheck-allow.txt allowlist.
  • After: the official action sets up Go from go.mod, installs govulncheck, and runs govulncheck ./... in default (text) mode — failing the job on any reachable finding. Same call-graph-reachability gate, ~71 fewer lines.

Kept unchanged: harden-runner, the hardened checkout (persist-credentials: false; the action's own checkout is disabled via repo-checkout: false), and the job-level GOMEMLIMIT: 12GiB + timeout-minutes: 15 (the scan still builds a whole-program call graph, so the OOM tuning still applies).

Trade-off (intentional)

This drops the .govulncheck-allow.txt risk-acceptance allowlist — the official action has no equivalent. No repo currently ships an allowlist file, so there is no behavior change for any current consumer. If a reachable advisory with no upstream fix (Fixed in: N/A) ever appears (e.g. a server-side symbol linked transitively via k8s.io/kubernetes), the gate will block with no in-workflow override; the recourse is then to bump the dep, drop the call, or re-introduce a gating shim. Chosen deliberately in favor of the simpler, official integration.

Note: the official action installs govulncheck@latest (vs. the previous pinned @v1.3.0); the action itself is SHA-pinned. Floating-latest is generally desirable for a vuln scanner (newest detection + advisory DB).

Scope

govulncheck is implemented only here — there is no custom govulncheck action in devantler-tech/actions, and consumers (e.g. ksail) don't reimplement it; they inherit this gate by calling validate-go-project.yaml@<tag>. So this single workflow change is the whole migration. Consumers pick it up automatically on the next release + their routine version bump — no per-consumer edit needed.

Validation

  • actionlint (with the CI's -ignore code-quality) and yamllint: pass.
  • Inputs match the action's documented interface (repo-checkout, go-version-file).
  • ci.yaml's [Test] Validate Go Project job only checks the workflow is callable (every internal job self-skips on this repo via the github.repository != ... guard); the gate runs end-to-end on consumers post-release.

🤖 Generated with Claude Code

Replace the hand-rolled govulncheck step (manual `go install` + a ~60-line
custom JSON-mode scan with a `.govulncheck-allow.txt` allowlist) with the
official golang/govulncheck-action@v1.0.4, pinned by SHA.

The action sets up Go from go.mod, installs govulncheck, and runs
`govulncheck ./...` in its default (text) mode, failing the job on any
reachable finding — the same call-graph-reachability gate as before. Kept:
the harden-runner step, the hardened checkout (persist-credentials:false, with
the action's own checkout disabled via repo-checkout:false), and the
GOMEMLIMIT/timeout-minutes guards (the scan still builds a whole-program call
graph, so the OOM tuning still applies).

This drops the `.govulncheck-allow.txt` risk-acceptance allowlist, which the
official action does not support. No repo currently ships an allowlist file,
so there is no behavior change for any current consumer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 1, 2026 21:10
@github-project-automation github-project-automation Bot moved this to 🫴 Ready in 🌊 Project Board Jun 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the reusable “Validate Go Project” workflow to use the official golang/govulncheck-action for Go vulnerability scanning, replacing the previous custom govulncheck installation + JSON parsing gate.

Changes:

  • Replace the hand-rolled govulncheck scan logic with golang/govulncheck-action@v1.0.4 (SHA-pinned) in .github/workflows/validate-go-project.yaml.
  • Update README documentation to reflect the new govulncheck implementation and remove the prior allowlist description.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
README.md Updates workflow feature documentation to reference golang/govulncheck-action and removes the allowlist text.
.github/workflows/validate-go-project.yaml Replaces the custom govulncheck setup/scan script with the official action while keeping hardened checkout and existing resource tuning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devantler devantler marked this pull request as ready for review June 1, 2026 21:24
@devantler devantler merged commit d6c7133 into main Jun 1, 2026
41 checks passed
@devantler devantler deleted the claude/govulncheck-official-action branch June 1, 2026 21:45
@github-project-automation github-project-automation Bot moved this from 🫴 Ready to ✅ Done in 🌊 Project Board Jun 1, 2026
@botantler
Copy link
Copy Markdown
Contributor

botantler Bot commented Jun 1, 2026

🎉 This PR is included in version 5.4.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released an issue that has been solved in a release

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants