Skip to content

Commit d6f7f63

Browse files
authored
GODRIVER-2540 Run govulncheck in CI builds. (#2136)
1 parent bbdb1b5 commit d6f7f63

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

.evergreen/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,14 @@ tasks:
647647
binary: bash
648648
args: [*task-runner, check-fmt, check-license, check-modules, lint]
649649

650+
- name: govulncheck
651+
tags: ["static-analysis"]
652+
commands:
653+
- command: subprocess.exec
654+
params:
655+
binary: bash
656+
args: [*task-runner, govulncheck]
657+
650658
- name: pull-request-helpers
651659
allowed_requesters: ["patch", "github_pr"]
652660
commands:

Taskfile.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ tasks:
8383
- GOOS=linux GOARCH=ppc64le etc/golangci-lint.sh
8484
- GOOS=linux GOARCH=s390x etc/golangci-lint.sh
8585

86+
govulncheck: bash etc/govulncheck.sh
87+
8688
update-notices: bash etc/generate_notices.pl > THIRD-PARTY-NOTICES
8789

8890
### Local testing tasks. ###

etc/govulncheck.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
# Use a specific Go version so that local govulncheck results are consistent
5+
# with CI results.
6+
#
7+
# Note: this needs to be updated if the listed Go version has vulnerabilities
8+
# discovered because they will show up in the scan results along with Go Driver
9+
# and dependency vulnerabilities.
10+
GO_VERSION=1.24.5
11+
12+
go install golang.org/dl/go$GO_VERSION@latest
13+
go${GO_VERSION} download
14+
go install golang.org/x/vuln/cmd/govulncheck@latest
15+
16+
# govulncheck uses the Go binary it finds from the PATH, so modify PATH to point
17+
# to the Go version we just downloaded.
18+
PATH="$(go${GO_VERSION} env GOROOT)/bin:$PATH" govulncheck -show verbose ./...

0 commit comments

Comments
 (0)