Skip to content

Commit 1df06f6

Browse files
committed
Run govulncheck during scheduled pipelines
Issue: PGO-2441
1 parent 9b3294b commit 1df06f6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.gitlab-ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,29 @@ go-test:
149149
reports:
150150
junit: '*.junit.xml'
151151

152+
# https://go.dev/blog/govulncheck
153+
govulncheck:
154+
stage: test
155+
needs: []
156+
rules:
157+
# Run this job during scheduled pipelines and merge requests that change dependencies.
158+
- changes: ['go.mod']
159+
160+
tags: ['image=container','cpu=${TARGET_ARCHITECTURE}']
161+
image: '${CI_REGISTRY}/containers/gitlab/go-toolset-ubi8'
162+
parallel:
163+
matrix:
164+
- TARGET_ARCHITECTURE: $[[ inputs.architectures ]]
165+
script:
166+
# Download govulncheck and log its version.
167+
- |-
168+
TOOL='golang.org/x/vuln/cmd/govulncheck@latest'
169+
go run "${TOOL}" --version
170+
171+
# Print any detected vulnerabilities to the log.
172+
# This fails the job when it detects a vulnerability in called code.
173+
- go run "${TOOL}" --format text --show verbose ./...
174+
152175
# See: [.github/workflows/trivy.yaml]
153176
trivy:
154177
stage: test

0 commit comments

Comments
 (0)