Skip to content

Commit 7f7585a

Browse files
authored
Move renovate build to separate workflow (#2712)
The workflow needs to run only on PRs opened by renovate and not on other kinds of events.
1 parent f76267f commit 7f7585a

File tree

3 files changed

+76
-20
lines changed

3 files changed

+76
-20
lines changed

.github/.cache/buster-for-generate

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
prepill derangeable afflicting imamship inamorata fibrillae Abelite villar Odelet inamorata predisce

.github/workflows/ci.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ jobs:
3333
min_k8s_version: ${{ steps.vars.outputs.min_k8s_version }}
3434
k8s_latest: ${{ steps.vars.outputs.k8s_latest }}
3535
helm_changes: ${{ steps.filter.outputs.charts }}
36-
permissions:
37-
contents: write
3836
steps:
3937
- name: Checkout Repository
4038
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
@@ -57,24 +55,6 @@ jobs:
5755
filters: |
5856
charts:
5957
- charts/nginx-gateway-fabric/**/*
60-
generate:
61-
- go.mod
62-
- go.sum
63-
- Makefile
64-
65-
# go mod tidy can be removed once https://github.com/renovatebot/renovate/issues/12999 is implemented
66-
- name: Update files for renovate
67-
run: |
68-
make generate-all
69-
cd tests && go mod tidy && go mod verify
70-
if: ${{ github.actor == 'renovate[bot]' && steps.filter.outputs.generate == 'true' }}
71-
72-
- name: Commit changes
73-
id: commit
74-
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
75-
with:
76-
commit_message: "Update files for renovate"
77-
if: ${{ github.actor == 'renovate[bot]' && steps.filter.outputs.generate == 'true' }}
7858
7959
- name: Output Variables
8060
id: vars

.github/workflows/renovate-build.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Run build for renovate PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
7+
permissions:
8+
contents: read
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
concurrency:
15+
group: ${{ github.ref_name }}-renovate
16+
cancel-in-progress: true
17+
18+
jobs:
19+
check:
20+
name: Check for changes
21+
runs-on: ubuntu-24.04
22+
outputs:
23+
generate: ${{ steps.filter.outputs.generate }}
24+
permissions:
25+
pull-requests: read
26+
if: ${{ github.actor == 'renovate[bot]' }}
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
30+
31+
- name: Check for changes
32+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
33+
id: filter
34+
with:
35+
filters: |
36+
generate:
37+
- go.mod
38+
- go.sum
39+
- Makefile
40+
build:
41+
name: Build for renovate PRs
42+
runs-on: ubuntu-24.04
43+
needs: check
44+
permissions:
45+
contents: write
46+
if: ${{ needs.check.outputs.generate == 'true' }}
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
50+
with:
51+
ref: ${{ github.head_ref }}
52+
token: ${{ secrets.NGINX_PAT }}
53+
54+
- name: Setup Golang Environment
55+
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
56+
with:
57+
go-version: stable
58+
cache-dependency-path: |
59+
go.sum
60+
.github/.cache/buster-for-generate
61+
62+
# go mod tidy can be removed once https://github.com/renovatebot/renovate/issues/12999 is implemented
63+
- name: Update files for renovate
64+
run: |
65+
make generate-all
66+
cd tests && go mod tidy && go mod verify
67+
68+
- name: Commit changes
69+
id: commit
70+
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
71+
with:
72+
commit_message: "Update files for renovate"
73+
commit_user_name: "renovate[bot]"
74+
commit_user_email: "<29139614+renovate[bot]@users.noreply.github.com>"
75+
commit_author: "renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>"

0 commit comments

Comments
 (0)