Skip to content

Commit 9f75334

Browse files
Merge pull request #315 from SgtCoDFish/govulncheck-goprivate
Add GOPRIVATE option for govulncheck
2 parents 684d99b + 931abbe commit 9f75334

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

modules/go/01_mod.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ generate-go-mod-tidy: | $(NEEDS_GO)
5858
shared_generate_targets += generate-go-mod-tidy
5959

6060
default_govulncheck_generate_base_dir := $(dir $(lastword $(MAKEFILE_LIST)))/base/
61+
6162
# The base directory used to copy the govulncheck GH action from. This can be
6263
# overwritten with an action with extra authentication or with a totally different
6364
# pipeline (eg. a GitLab pipeline).
@@ -67,6 +68,10 @@ govulncheck_generate_base_dir ?= $(default_govulncheck_generate_base_dir)
6768
# being run on every fork of the repo.
6869
govulncheck_generate_org ?= cert-manager
6970

71+
# Any closed-source or inaccessible Go modules that should be ignored by govulncheck; not needed
72+
# for most open-source projects.
73+
govulncheck_goprivate ?=
74+
7075
.PHONY: generate-govulncheck
7176
## Generate base files in the repository
7277
## @category [shared] Generate/ Verify
@@ -96,7 +101,7 @@ verify-govulncheck: | $(NEEDS_GOVULNCHECK)
96101
target=$$(dirname $${d}); \
97102
echo "Running 'GOTOOLCHAIN=go$(VENDORED_GO_VERSION) $(bin_dir)/tools/govulncheck ./...' in directory '$${target}'"; \
98103
pushd "$${target}" >/dev/null; \
99-
GOTOOLCHAIN=go$(VENDORED_GO_VERSION) $(GOVULNCHECK) ./... || exit; \
104+
GOPRIVATE=$(govulncheck_goprivate) GOTOOLCHAIN=go$(VENDORED_GO_VERSION) $(GOVULNCHECK) ./... || exit; \
100105
popd >/dev/null; \
101106
echo ""; \
102107
done

0 commit comments

Comments
 (0)