Skip to content

Commit 59fa131

Browse files
committed
allow custom orgs for running govulncheck jobs
Repos outside the cert-manager org might want to use the govulncheck job; this could be other repos depending on makefile-modules, or forks of cert-manager org repos who want to run the job. Signed-off-by: Ashley Davis <ashley.davis@cyberark.com>
1 parent c3d364a commit 59fa131

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

modules/go/01_mod.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,16 @@ default_govulncheck_generate_base_dir := $(dir $(lastword $(MAKEFILE_LIST)))/bas
6363
# pipeline (eg. a GitLab pipeline).
6464
govulncheck_generate_base_dir ?= $(default_govulncheck_generate_base_dir)
6565

66+
# The org name used in the govulncheck GH action. This is used to prevent the govulncheck job
67+
# being run on every fork of the repo.
68+
govulncheck_generate_org ?= cert-manager
69+
6670
.PHONY: generate-govulncheck
6771
## Generate base files in the repository
6872
## @category [shared] Generate/ Verify
6973
generate-govulncheck:
70-
cp -r $(govulncheck_generate_base_dir)/. ./
74+
@mkdir -p ./.github/workflows
75+
sed 's/ORGNAMEHERE/$(govulncheck_generate_org)/g' $(govulncheck_generate_base_dir)/.github/workflows/govulncheck.yaml > .github/workflows/govulncheck.yaml
7176

7277
shared_generate_targets += generate-govulncheck
7378

modules/go/base/.github/workflows/govulncheck.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
govulncheck:
1818
runs-on: ubuntu-latest
1919

20-
if: github.repository_owner == 'cert-manager'
20+
if: github.repository_owner == 'ORGNAMEHERE'
2121

2222
steps:
2323
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

0 commit comments

Comments
 (0)