Skip to content

Commit 1336046

Browse files
authored
chore(deps): auto-regenerate manifests on Renovate manifests bumps (#4919)
* chore: auto-regenerate manifests on Renovate manifests bumps
1 parent 8468d14 commit 1336046

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will regenerate the manifests, commit&push them on a PR labeled with `renovate/auto-regenerate`.
2+
# It's to make sure that Renovate-created PRs that update kustomize dependencies also update the manifests.
3+
name: Regenerate on deps bump
4+
5+
on:
6+
pull_request:
7+
types:
8+
- labeled
9+
10+
jobs:
11+
regenerate:
12+
if: contains(github.event.*.labels.*.name, 'renovate/auto-regenerate')
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.event.pull_request.head.ref }}
18+
19+
- name: setup golang
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version-file: go.mod
23+
24+
- name: regenerate
25+
run: make manifests
26+
27+
- name: commit and push (if changes detected)
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: |
31+
git config --global user.name "github-actions"
32+
git config --global user.email "[email protected]"
33+
git add .
34+
git diff-index --quiet HEAD || \
35+
git commit -m "chore: regenerate manifests" && \
36+
git push origin ${{ github.event.pull_request.head.ref }}

renovate.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
"matchUpdateTypes": ["minor"],
3434
"matchDepPatterns": [".*@only-patch"],
3535
"enabled": false
36+
},
37+
{
38+
"description": "Add 'renovate/auto-regenerate' label to a PR if it changes kustomize files to trigger regenerate_on_deps_bump.yaml workflow.",
39+
"matchManagers": ["kustomize"],
40+
"addLabels": ["renovate/auto-regenerate"]
3641
}
3742
]
3843
}

0 commit comments

Comments
 (0)