Skip to content

Commit

Permalink
Fix govulncheck CI check on release-3.5
Browse files Browse the repository at this point in the history
This commit fixed the Go Vulnerability Checker CI job, which isn't
scanning for all go.mod files within the project.

Reference:
- #18168

Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
  • Loading branch information
henrybear327 committed Jun 13, 2024
1 parent fb66ea6 commit 1b6e585
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/govuln.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,18 @@ jobs:
- run: |
set -euo pipefail
go install golang.org/x/vuln/cmd/govulncheck@latest && govulncheck ./...
go install golang.org/x/vuln/cmd/govulncheck@latest
# Find all go.mod files recursively, as we have multiple of them within the project
gomod_files=$(find . -name go.mod)
# Loop through each go.mod file path
for filepath in $gomod_files; do
# Extract directory path using dirname
dirpath=$(dirname "$filepath")
echo "scanning $dirpath"
govulncheck -C $dirpath ./...
done
echo "Finished looping through go.mod directories."

0 comments on commit 1b6e585

Please sign in to comment.