Skip to content

Add a workflow to auto-bump vulnerable dependencies#5437

Open
pietern wants to merge 4 commits into
mainfrom
add-vulnbump-workflow
Open

Add a workflow to auto-bump vulnerable dependencies#5437
pietern wants to merge 4 commits into
mainfrom
add-vulnbump-workflow

Conversation

@pietern
Copy link
Copy Markdown
Contributor

@pietern pietern commented Jun 4, 2026

Adds a daily workflow that upgrades the root module's dependencies flagged by govulncheck to their fixed versions and opens a PR, alongside the existing Bump Go toolchain workflow.

govulncheck -scan module reports every advisory affecting a required module regardless of reachability, which is broader than trivy (GHSA-fed, so it lags golang.org/x/* advisories). The new tools/vulnbump command consumes the scan's JSON, bumps each affected dependency to its highest fixed version via go get + go mod tidy, and renders the PR summary.

  • Standard-library advisories are skipped and left to the Bump Go toolchain workflow.
  • A govulncheck error aborts the job rather than being mistaken for "no vulnerabilities".
  • The summary labels each advisory with its CVE (read from the scan output, no extra lookup).
  • govulncheck is pinned as a tool dependency in tools/go.mod (bumpable by dependabot); its database is fetched from https://vuln.go.dev at runtime, so scans still use the latest advisories.

Parsing, version selection, and summary rendering live in tools/vulnbump with unit and end-to-end tests.

This pull request and its description were written by Isaac.

Adds a daily workflow that upgrades the root module's dependencies flagged
by govulncheck to their fixed versions and opens a PR. The tools/vulnbump
command parses the scan JSON, applies the bumps via go get + go mod tidy,
and renders the PR summary. Standard-library advisories are left to the
Bump Go toolchain workflow.

Co-authored-by: Isaac
@pietern pietern temporarily deployed to test-trigger-is June 4, 2026 09:59 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 4, 2026 09:59 — with GitHub Actions Inactive
Add govulncheck to the tools/go.mod tool directive and build it from there,
so its version is managed alongside the other tools (and bumpable by
dependabot) rather than hardcoded as @Version in the workflow. The
vulnerability database is still fetched from vuln.go.dev at runtime, so the
pinned binary scans against the latest advisories.

Also point setup-go at tools/go.mod, the module this job compiles.

Co-authored-by: Isaac
@pietern pietern temporarily deployed to test-trigger-is June 4, 2026 10:03 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 4, 2026 10:03 — with GitHub Actions Inactive
Use `go tool -modfile=tools/go.mod govulncheck`, matching the repo's GO_TOOL
idiom in Taskfile.yml. -modfile resolves the pinned tool from tools/go.mod
while it scans the root module (the working directory), so there's no need to
build the binary first.

Co-authored-by: Isaac
@pietern pietern temporarily deployed to test-trigger-is June 4, 2026 10:08 — with GitHub Actions Inactive
@pietern pietern temporarily deployed to test-trigger-is June 4, 2026 10:08 — with GitHub Actions Inactive
Tests run from the package directory, so the fixture can be read with
os.ReadFile rather than //go:embed.

Co-authored-by: Isaac
@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

Commit: 9d6b347

Run: 26945359797

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants