From 043096067f2368e173c928581257e1ada305b593 Mon Sep 17 00:00:00 2001 From: Ivan Valdes Date: Sat, 15 Jun 2024 15:47:13 -0700 Subject: [PATCH] Add run-govulncheck Makefile target Add a `Makefile` target to run govuln across the submodules. So, it can be imported into a prow job. Signed-off-by: Ivan Valdes --- Makefile | 7 +++++++ scripts/test.sh | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/Makefile b/Makefile index 22ecab9810b..3690c09bfc0 100644 --- a/Makefile +++ b/Makefile @@ -164,6 +164,13 @@ ifeq (, $(shell which yamlfmt)) endif yamlfmt -conf tools/.yamlfmt . +.PHONY: run-govulncheck +run-govulncheck: +ifeq (, $(shell which govulncheck)) + $(shell go install golang.org/x/vuln/cmd/govulncheck@latest) +endif + PASSES="govuln" ./scripts/test.sh + # Tools GOLANGCI_LINT_VERSION = $(shell cd tools/mod && go list -m -f {{.Version}} github.com/golangci/golangci-lint) diff --git a/scripts/test.sh b/scripts/test.sh index b1cf15c8231..5fa11548794 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -366,6 +366,10 @@ function markdown_marker_pass { fi } +function govuln_pass { + run_for_modules run govulncheck -show verbose +} + function govet_pass { run_for_modules generic_checker run go vet }