Skip to content

Commit 34940cc

Browse files
Merge pull request #107 from cert-manager/self-upgrade-main
[CI] Self-upgrade merging self-upgrade-main into main
2 parents 4cc839d + 385cb45 commit 34940cc

File tree

15 files changed

+188
-104
lines changed

15 files changed

+188
-104
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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/chainguard/make-self-upgrade.sts.yaml instead.
3+
4+
issuer: https://token.actions.githubusercontent.com
5+
subject_pattern: ^repo:cert-manager/csi-lib:ref:refs/heads/(main|master)$
6+
7+
permissions:
8+
contents: write
9+
pull_requests: write
10+
workflows: write
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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/chainguard/renovate.sts.yaml instead.
3+
4+
issuer: https://token.actions.githubusercontent.com
5+
subject_pattern: ^repo:cert-manager/csi-lib:ref:refs/heads/(main|master)$
6+
7+
permissions:
8+
administration: read
9+
contents: write
10+
issues: write
11+
pull_requests: write
12+
security_events: read
13+
statuses: write
14+
workflows: write

.github/dependabot.yaml

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

.github/renovate.json5

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
66
enabled: true,
77
gitAuthor: 'Renovate Bot <[email protected]>',
8+
gitIgnoredAuthors: [
9+
'Renovate Bot <[email protected]>',
10+
'cert-manager-bot <[email protected]>',
11+
],
812
recreateWhen: 'always', // TODO: Remove; temporary fix to force Renovate to ignore "foreign" commits
913
enabledManagers: [
14+
'github-actions',
1015
'gomod',
1116
],
1217
extends: [
@@ -24,14 +29,25 @@
2429
'ok-to-test',
2530
'release-note-none',
2631
],
27-
postUpgradeTasks: {
28-
commands: [
29-
'make generate',
30-
],
31-
executionMode: 'branch',
32-
},
3332
// packageRules uses globs for matchPackageNames. Some packages have a separate major version i.e. /v on them which is when we would need package**/**.
3433
packageRules: [
34+
{
35+
groupName: 'Misc GitHub actions',
36+
matchManagers: [
37+
'github-actions',
38+
],
39+
},
40+
{
41+
matchManagers: [
42+
'gomod',
43+
],
44+
postUpgradeTasks: {
45+
commands: [
46+
'make vendor-go generate',
47+
],
48+
executionMode: 'branch',
49+
}
50+
},
3551
{
3652
groupName: 'Misc Go deps',
3753
matchManagers: [
@@ -141,5 +157,10 @@
141157
],
142158
ignorePaths: [
143159
'**/vendor/**',
160+
// Exclude files that are mastered from makefile-modules and shouldn't be upgraded in projects using makefile-modules.
161+
'make/_shared/**',
162+
'.github/workflows/govulncheck.yaml',
163+
'.github/workflows/make-self-upgrade.yaml',
164+
'.github/workflows/renovate.yaml',
144165
],
145166
}

.github/workflows/make-self-upgrade.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ jobs:
1818
if: github.repository == 'cert-manager/csi-lib'
1919

2020
permissions:
21-
contents: write
22-
pull-requests: write
21+
id-token: write
2322

2423
env:
2524
SOURCE_BRANCH: "${{ github.ref_name }}"
@@ -32,11 +31,20 @@ jobs:
3231
echo "This workflow should not be run on a non-branch-head."
3332
exit 1
3433
34+
- name: Octo STS Token Exchange
35+
uses: octo-sts/action@e480437973a6f6ac2e9caa40ecabedc870d76395 # main
36+
id: octo-sts
37+
with:
38+
scope: 'cert-manager/csi-lib'
39+
identity: make-self-upgrade
40+
3541
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3642
# Adding `fetch-depth: 0` makes sure tags are also fetched. We need
3743
# the tags so `git describe` returns a valid version.
3844
# see https://github.com/actions/checkout/issues/701 for extra info about this option
39-
with: { fetch-depth: 0 }
45+
with:
46+
fetch-depth: 0
47+
token: ${{ steps.octo-sts.outputs.token }}
4048

4149
- id: go-version
4250
run: |
@@ -75,6 +83,7 @@ jobs:
7583
- if: ${{ steps.is-up-to-date.outputs.result != 'true' }}
7684
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
7785
with:
86+
github-token: ${{ steps.octo-sts.outputs.token }}
7887
script: |
7988
const { repo, owner } = context.repo;
8089
const pulls = await github.rest.pulls.list({

.github/workflows/renovate.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ jobs:
1717
if: github.repository == 'cert-manager/csi-lib'
1818

1919
permissions:
20-
contents: write
21-
issues: write
22-
statuses: write
23-
pull-requests: write
20+
id-token: write
2421

2522
steps:
2623
- name: Fail if branch is not head of branch.
@@ -29,11 +26,20 @@ jobs:
2926
echo "This workflow should not be run on a non-branch-head."
3027
exit 1
3128
29+
- name: Octo STS Token Exchange
30+
uses: octo-sts/action@e480437973a6f6ac2e9caa40ecabedc870d76395 # main
31+
id: octo-sts
32+
with:
33+
scope: 'cert-manager/csi-lib'
34+
identity: renovate
35+
3236
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3337
# Adding `fetch-depth: 0` makes sure tags are also fetched. We need
3438
# the tags so `git describe` returns a valid version.
3539
# see https://github.com/actions/checkout/issues/701 for extra info about this option
36-
with: { fetch-depth: 0 }
40+
with:
41+
fetch-depth: 0
42+
token: ${{ steps.octo-sts.outputs.token }}
3743

3844
- id: go-version
3945
run: |
@@ -47,7 +53,7 @@ jobs:
4753
uses: renovatebot/github-action@a447f09147d00e00ae2a82ad5ef51ca89352da80 # v43.0.9
4854
with:
4955
configurationFile: .github/renovate.json5
50-
token: ${{ secrets.GITHUB_TOKEN }}
56+
token: ${{ steps.octo-sts.outputs.token }}
5157
env:
5258
RENOVATE_REPOSITORIES: '["${{ github.repository }}"]'
5359
RENOVATE_ONBOARDING: "false"

klone.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,55 +9,55 @@ targets:
99
- folder_name: boilerplate
1010
repo_url: https://github.com/cert-manager/makefile-modules.git
1111
repo_ref: main
12-
repo_hash: 63afb5c9df5725b127e132082e1c35997bd8e516
12+
repo_hash: 217b9616a01c901044098e5ae0c285ae3b1223ac
1313
repo_path: modules/boilerplate
1414
- folder_name: cert-manager
1515
repo_url: https://github.com/cert-manager/makefile-modules.git
1616
repo_ref: main
17-
repo_hash: 63afb5c9df5725b127e132082e1c35997bd8e516
17+
repo_hash: 217b9616a01c901044098e5ae0c285ae3b1223ac
1818
repo_path: modules/cert-manager
1919
- folder_name: controller-gen
2020
repo_url: https://github.com/cert-manager/makefile-modules.git
2121
repo_ref: main
22-
repo_hash: 63afb5c9df5725b127e132082e1c35997bd8e516
22+
repo_hash: 217b9616a01c901044098e5ae0c285ae3b1223ac
2323
repo_path: modules/controller-gen
2424
- folder_name: generate-verify
2525
repo_url: https://github.com/cert-manager/makefile-modules.git
2626
repo_ref: main
27-
repo_hash: 63afb5c9df5725b127e132082e1c35997bd8e516
27+
repo_hash: 217b9616a01c901044098e5ae0c285ae3b1223ac
2828
repo_path: modules/generate-verify
2929
- folder_name: go
3030
repo_url: https://github.com/cert-manager/makefile-modules.git
3131
repo_ref: main
32-
repo_hash: 63afb5c9df5725b127e132082e1c35997bd8e516
32+
repo_hash: 217b9616a01c901044098e5ae0c285ae3b1223ac
3333
repo_path: modules/go
3434
- folder_name: help
3535
repo_url: https://github.com/cert-manager/makefile-modules.git
3636
repo_ref: main
37-
repo_hash: 63afb5c9df5725b127e132082e1c35997bd8e516
37+
repo_hash: 217b9616a01c901044098e5ae0c285ae3b1223ac
3838
repo_path: modules/help
3939
- folder_name: kind
4040
repo_url: https://github.com/cert-manager/makefile-modules.git
4141
repo_ref: main
42-
repo_hash: 63afb5c9df5725b127e132082e1c35997bd8e516
42+
repo_hash: 217b9616a01c901044098e5ae0c285ae3b1223ac
4343
repo_path: modules/kind
4444
- folder_name: klone
4545
repo_url: https://github.com/cert-manager/makefile-modules.git
4646
repo_ref: main
47-
repo_hash: 63afb5c9df5725b127e132082e1c35997bd8e516
47+
repo_hash: 217b9616a01c901044098e5ae0c285ae3b1223ac
4848
repo_path: modules/klone
4949
- folder_name: oci-build
5050
repo_url: https://github.com/cert-manager/makefile-modules.git
5151
repo_ref: main
52-
repo_hash: 63afb5c9df5725b127e132082e1c35997bd8e516
52+
repo_hash: 217b9616a01c901044098e5ae0c285ae3b1223ac
5353
repo_path: modules/oci-build
5454
- folder_name: repository-base
5555
repo_url: https://github.com/cert-manager/makefile-modules.git
5656
repo_ref: main
57-
repo_hash: 63afb5c9df5725b127e132082e1c35997bd8e516
57+
repo_hash: 217b9616a01c901044098e5ae0c285ae3b1223ac
5858
repo_path: modules/repository-base
5959
- folder_name: tools
6060
repo_url: https://github.com/cert-manager/makefile-modules.git
6161
repo_ref: main
62-
repo_hash: 63afb5c9df5725b127e132082e1c35997bd8e516
62+
repo_hash: 217b9616a01c901044098e5ae0c285ae3b1223ac
6363
repo_path: modules/tools

make/_shared/repository-base/01_mod.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ else
3434
## Generate base files in the repository
3535
## @category [shared] Generate/ Verify
3636
generate-base:
37+
# TODO(erikgb): Remove; just a temporary command to clean out Dependabot files
38+
rm -f ./.github/dependabot.yaml
3739
cp -r $(repository_base_dir)/. ./
3840
cd $(repository_base_dir) && \
3941
find . -type f | while read file; do \

make/_shared/repository-base/base-dependabot/.github/dependabot.yaml

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

make/_shared/repository-base/base-dependabot/.github/renovate.json5

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@
55
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
66
enabled: true,
77
gitAuthor: 'Renovate Bot <[email protected]>',
8+
gitIgnoredAuthors: [
9+
'Renovate Bot <[email protected]>',
10+
'cert-manager-bot <[email protected]>',
11+
],
812
recreateWhen: 'always', // TODO: Remove; temporary fix to force Renovate to ignore "foreign" commits
913
enabledManagers: [
14+
'github-actions',
1015
'gomod',
1116
],
1217
extends: [
@@ -24,14 +29,25 @@
2429
'ok-to-test',
2530
'release-note-none',
2631
],
27-
postUpgradeTasks: {
28-
commands: [
29-
'make generate',
30-
],
31-
executionMode: 'branch',
32-
},
3332
// packageRules uses globs for matchPackageNames. Some packages have a separate major version i.e. /v on them which is when we would need package**/**.
3433
packageRules: [
34+
{
35+
groupName: 'Misc GitHub actions',
36+
matchManagers: [
37+
'github-actions',
38+
],
39+
},
40+
{
41+
matchManagers: [
42+
'gomod',
43+
],
44+
postUpgradeTasks: {
45+
commands: [
46+
'make vendor-go generate',
47+
],
48+
executionMode: 'branch',
49+
}
50+
},
3551
{
3652
groupName: 'Misc Go deps',
3753
matchManagers: [
@@ -141,5 +157,10 @@
141157
],
142158
ignorePaths: [
143159
'**/vendor/**',
160+
// Exclude files that are mastered from makefile-modules and shouldn't be upgraded in projects using makefile-modules.
161+
'make/_shared/**',
162+
'.github/workflows/govulncheck.yaml',
163+
'.github/workflows/make-self-upgrade.yaml',
164+
'.github/workflows/renovate.yaml',
144165
],
145166
}

0 commit comments

Comments
 (0)