Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions modules/go/01_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,24 @@ generate-go-mod-tidy: | $(NEEDS_GO)

shared_generate_targets += generate-go-mod-tidy

ifndef govulncheck_skip
Comment thread
inteon marked this conversation as resolved.
base_dir := $(dir $(lastword $(MAKEFILE_LIST)))/base/

default_govulncheck_generate_base_dir := $(dir $(lastword $(MAKEFILE_LIST)))/base/
# The base directory used to copy the govulncheck GH action from. This can be
# overwritten with an action with extra authentication or with a totally different
# pipeline (eg. a GitLab pipeline).
govulncheck_generate_base_dir ?= $(default_govulncheck_generate_base_dir)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not used, use dont_generate_govulncheck instead and manually maintain the yaml file.


# The org name used in the govulncheck GH action. This is used to prevent the govulncheck job
# being run on every fork of the repo.
govulncheck_generate_org ?= cert-manager
ifndef dont_generate_govulncheck

.PHONY: generate-govulncheck
## Generate base files in the repository
## @category [shared] Generate/ Verify
generate-govulncheck:
@mkdir -p ./.github/workflows
sed 's/ORGNAMEHERE/$(govulncheck_generate_org)/g' $(govulncheck_generate_base_dir)/.github/workflows/govulncheck.yaml > .github/workflows/govulncheck.yaml
cp -r $(base_dir)/. ./
cd $(base_dir) && \
find . -type f | while read file; do \
sed "s|{{REPLACE:GH-REPOSITORY}}|$(repo_name:github.com/%=%)|g" "$$file" > "$(CURDIR)/$$file"; \
done

shared_generate_targets += generate-govulncheck

endif # dont_generate_govulncheck

.PHONY: verify-govulncheck
## Verify all Go modules for vulnerabilities using govulncheck
## @category [shared] Generate/ Verify
Expand All @@ -107,9 +104,6 @@ verify-govulncheck: | $(NEEDS_GOVULNCHECK)
echo ""; \
done

endif # govulncheck_skip


.PHONY: generate-golangci-lint-config
## Generate a golangci-lint configuration file
## @category [shared] Generate/ Verify
Expand Down
2 changes: 1 addition & 1 deletion modules/go/base/.github/workflows/govulncheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
govulncheck:
runs-on: ubuntu-latest

if: github.repository_owner == 'ORGNAMEHERE'
if: github.repository == '{{REPLACE:GH-REPOSITORY}}'

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
Expand Down
4 changes: 0 additions & 4 deletions modules/helm/helm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ ifndef bin_dir
$(error bin_dir is not set)
endif

ifndef repo_name
Copy link
Copy Markdown
Member Author

@inteon inteon Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was unused here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. That variable is used elsewhere in other modules, just not in helm module so no need to error here if the variable is unset.

$(error repo_name is not set)
endif

ifndef helm_chart_source_dir
$(error helm_chart_source_dir is not set)
endif
Expand Down
12 changes: 12 additions & 0 deletions modules/repository-base/01_mod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ifndef repo_name
$(error repo_name is not set)
endif

base_dir := $(dir $(lastword $(MAKEFILE_LIST)))/base/
base_dependabot_dir := $(dir $(lastword $(MAKEFILE_LIST)))/base-dependabot/

Expand All @@ -21,12 +25,20 @@ ifdef repository_base_no_dependabot
## @category [shared] Generate/ Verify
generate-base:
cp -r $(base_dir)/. ./
cd $(base_dir) && \
find . -type f | while read file; do \
sed "s|{{REPLACE:GH-REPOSITORY}}|$(repo_name:github.com/%=%)|g" "$$file" > "$(CURDIR)/$$file"; \
done
else
.PHONY: generate-base
## Generate base files in the repository
## @category [shared] Generate/ Verify
generate-base:
cp -r $(base_dir)/. ./
cd $(base_dir) && \
find . -type f | while read file; do \
sed "s|{{REPLACE:GH-REPOSITORY}}|$(repo_name:github.com/%=%)|g" "$$file" > "$(CURDIR)/$$file"; \
done
cp -r $(base_dependabot_dir)/. ./
endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
self_upgrade:
runs-on: ubuntu-latest

if: github.repository_owner == 'cert-manager'
if: github.repository == '{{REPLACE:GH-REPOSITORY}}'

permissions:
contents: write
Expand Down
Loading