Skip to content

Commit 2eb630c

Browse files
authored
ci: wire govulncheck into mise and CI (#68)
Signed-off-by: Devin Buhl <devin@buhl.casa>
1 parent 32591e5 commit 2eb630c

4 files changed

Lines changed: 42 additions & 7 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,29 @@ jobs:
162162
export KUBECONFIG="${HOME}/.kube/config"
163163
mise run helm-test
164164
165+
go-vulncheck:
166+
if: >-
167+
${{ !(startsWith(github.head_ref, 'release-please--')
168+
&& github.event.pull_request.head.repo.full_name == github.repository) }}
169+
name: Go Vulncheck
170+
runs-on: ubuntu-24.04
171+
permissions:
172+
contents: read
173+
steps:
174+
- name: Checkout
175+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
176+
with:
177+
persist-credentials: false
178+
179+
- name: Setup Mise
180+
uses: jdx/mise-action@9e7f7633ff6f6d6048a9418a68d48f288f50eb14 # v4.2.3
181+
with:
182+
experimental: true
183+
install_args: --locked
184+
185+
- name: Run govulncheck
186+
run: mise run vulncheck
187+
165188
helm-lint:
166189
if: >-
167190
${{ !(startsWith(github.head_ref, 'release-please--')
@@ -247,6 +270,7 @@ jobs:
247270
needs:
248271
- go-lint
249272
- go-test
273+
- go-vulncheck
250274
- helm-e2e
251275
- helm-lint
252276
- helm-unittest

‎.mise/config.toml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[tools]
22
actionlint = "1.7.12"
33
go = "1.26.5"
4+
"go:golang.org/x/vuln/cmd/govulncheck" = "1.6.0"
45
golangci-lint = "2.12.2"
56
helm = "4.2.3"
67
cosign = "3.1.2"
@@ -23,6 +24,10 @@ run = "go fmt ./..."
2324
description = "Run go vet against code"
2425
run = "go vet ./..."
2526

27+
[tasks.vulncheck]
28+
description = "Scan for known vulnerabilities with govulncheck"
29+
run = "govulncheck ./..."
30+
2631
[tasks.test]
2732
description = "Run tests with coverage"
2833
run = "go test -race $(go list ./...) -coverprofile cover.out"

‎.mise/mise.lock‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎AGENTS.md‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,10 @@ timeout`), which is what drives release-please's version bumps. Individual
5555
a comment: that belongs in the PR description and rots as the code moves
5656
on.
5757
- **Go 1.26.** Check `go.mod`'s `go` directive and `.mise/config.toml`'s
58-
`tools.go` for the exact pinned versions before assuming they match:
59-
Renovate bumps them independently, so a patch-version gap between the two
60-
is normal, not a bug to "fix" reflexively. When a newer construct is
58+
`tools.go` for the exact pinned versions. Renovate bumps them together
59+
in one grouped Go-toolchain PR, patch releases included, so the two
60+
should match; a lingering gap means a toolchain PR hasn't merged yet
61+
(or something is off) and is worth flagging, not routine drift. When a newer construct is
6162
genuinely more idiomatic, use it: Go 1.26 added `errors.AsType[T](err)`, a
6263
generic type-safe replacement for the `var t *T; errors.As(err, &t)`
6364
two-step; prefer it in new code. `go fix` (rebuilt in 1.26 as a
@@ -190,7 +191,8 @@ assuming.
190191

191192
## Security
192193

193-
`govulncheck ./...` (`go install golang.org/x/vuln/cmd/govulncheck@latest`)
194-
isn't wired into CI anywhere in the fleet yet. Run it before cutting a
195-
release regardless, and consider proposing it as a `mise run` task / CI job
196-
here.
194+
`govulncheck ./...` runs in CI as the `Go Vulncheck` job, via `mise run
195+
vulncheck` with the tool version pinned in `.mise/config.toml`. Run the
196+
same task locally before cutting a release; a new advisory that fails the
197+
job is an action item (upgrade the module or the Go toolchain), not noise
198+
to suppress.

0 commit comments

Comments
 (0)