Skip to content

Commit 8d559ad

Browse files
authored
Merge pull request #556 from jetstack/step1-makefile-modules
🔥 Migrating to Makefile Modules ALL AT ONCE 🔥
2 parents bd67a58 + 458cab4 commit 8d559ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+5315
-676
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Setup repo access'
2+
description: 'Setups authenticate to GitHub repos'
3+
inputs:
4+
DEPLOY_KEY_READ_VENAFI_CONNECTION_LIB:
5+
required: true
6+
description: "DEPLOY_KEY_READ_VENAFI_CONNECTION_LIB secret"
7+
outputs: {}
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Configure jetstack/venafi-connection-lib repo pull access
12+
shell: bash
13+
run: |
14+
mkdir ~/.ssh
15+
chmod 700 ~/.ssh
16+
17+
echo "${{ inputs.DEPLOY_KEY_READ_VENAFI_CONNECTION_LIB }}" > ~/.ssh/venafi_connection_lib_id
18+
chmod 600 ~/.ssh/venafi_connection_lib_id
19+
20+
cat <<EOT >> ~/.ssh/config
21+
Host venafi-connection-lib.github.com
22+
HostName github.com
23+
IdentityFile ~/.ssh/venafi_connection_lib_id
24+
IdentitiesOnly yes
25+
EOT
26+
27+
cat <<EOT >> ~/.gitconfig
28+
[url "[email protected]:jetstack/venafi-connection-lib"]
29+
insteadOf = https://github.com/jetstack/venafi-connection-lib
30+
EOT
31+
32+
echo "GOPRIVATE=github.com/jetstack/venafi-connection-lib" >> $GITHUB_ENV

.github/dependabot.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
2+
# Edit https://github.com/cert-manager/makefile-modules/blob/main/modules/repository-base/base/.github/dependabot.yaml instead.
3+
4+
# Update Go dependencies and GitHub Actions dependencies daily.
15
version: 2
26
updates:
37
- package-ecosystem: gomod
@@ -14,10 +18,3 @@ updates:
1418
groups:
1519
all:
1620
patterns: ["*"]
17-
- package-ecosystem: docker
18-
directory: /
19-
schedule:
20-
interval: daily
21-
groups:
22-
all:
23-
patterns: ["*"]

.github/workflows/chart-test.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/govulncheck.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
2+
# Edit https://github.com/cert-manager/makefile-modules/blob/main/modules/go/base/.github/workflows/govulncheck.yaml instead.
3+
4+
# Run govulncheck at midnight every night on the main branch,
5+
# to alert us to recent vulnerabilities which affect the Go code in this
6+
# project.
7+
name: govulncheck
8+
on:
9+
workflow_dispatch: {}
10+
schedule:
11+
- cron: '0 0 * * *'
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
govulncheck:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
22+
23+
- id: go-version
24+
run: |
25+
make print-go-version >> "$GITHUB_OUTPUT"
26+
27+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
28+
with:
29+
go-version: ${{ steps.go-version.outputs.result }}
30+
31+
- run: make verify-govulncheck
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
2+
# Edit https://github.com/cert-manager/makefile-modules/blob/main/modules/repository-base/base/.github/workflows/make-self-upgrade.yaml instead.
3+
4+
name: make-self-upgrade
5+
concurrency: make-self-upgrade
6+
on:
7+
workflow_dispatch: {}
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
self_upgrade:
16+
runs-on: ubuntu-latest
17+
18+
if: github.repository_owner == 'cert-manager'
19+
20+
permissions:
21+
contents: write
22+
pull-requests: write
23+
24+
env:
25+
SOURCE_BRANCH: "${{ github.ref_name }}"
26+
SELF_UPGRADE_BRANCH: "self-upgrade-${{ github.ref_name }}"
27+
28+
steps:
29+
- name: Fail if branch is not head of branch.
30+
if: ${{ !startsWith(github.ref, 'refs/heads/') && env.SOURCE_BRANCH != '' && env.SELF_UPGRADE_BRANCH != '' }}
31+
run: |
32+
echo "This workflow should not be run on a non-branch-head."
33+
exit 1
34+
35+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
36+
37+
- id: go-version
38+
run: |
39+
make print-go-version >> "$GITHUB_OUTPUT"
40+
41+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
42+
with:
43+
go-version: ${{ steps.go-version.outputs.result }}
44+
45+
- run: |
46+
git checkout -B "$SELF_UPGRADE_BRANCH"
47+
48+
- run: |
49+
make -j upgrade-klone
50+
make -j generate
51+
52+
- id: is-up-to-date
53+
shell: bash
54+
run: |
55+
git_status=$(git status -s)
56+
is_up_to_date="true"
57+
if [ -n "$git_status" ]; then
58+
is_up_to_date="false"
59+
echo "The following changes will be committed:"
60+
echo "$git_status"
61+
fi
62+
echo "result=$is_up_to_date" >> "$GITHUB_OUTPUT"
63+
64+
- if: ${{ steps.is-up-to-date.outputs.result != 'true' }}
65+
run: |
66+
git config --global user.name "cert-manager-bot"
67+
git config --global user.email "[email protected]"
68+
git add -A && git commit -m "BOT: run 'make upgrade-klone' and 'make generate'" --signoff
69+
git push -f origin "$SELF_UPGRADE_BRANCH"
70+
71+
- if: ${{ steps.is-up-to-date.outputs.result != 'true' }}
72+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
73+
with:
74+
script: |
75+
const { repo, owner } = context.repo;
76+
const pulls = await github.rest.pulls.list({
77+
owner: owner,
78+
repo: repo,
79+
head: owner + ':' + process.env.SELF_UPGRADE_BRANCH,
80+
base: process.env.SOURCE_BRANCH,
81+
state: 'open',
82+
});
83+
84+
if (pulls.data.length < 1) {
85+
const result = await github.rest.pulls.create({
86+
title: '[CI] Merge ' + process.env.SELF_UPGRADE_BRANCH + ' into ' + process.env.SOURCE_BRANCH,
87+
owner: owner,
88+
repo: repo,
89+
head: process.env.SELF_UPGRADE_BRANCH,
90+
base: process.env.SOURCE_BRANCH,
91+
body: [
92+
'This PR is auto-generated to bump the Makefile modules.',
93+
].join('\n'),
94+
});
95+
await github.rest.issues.addLabels({
96+
owner,
97+
repo,
98+
issue_number: result.data.number,
99+
labels: ['skip-review']
100+
});
101+
}

.github/workflows/release-master.yml

Lines changed: 0 additions & 138 deletions
This file was deleted.

0 commit comments

Comments
 (0)