Skip to content

Commit 3475f1c

Browse files
authored
chore: enable auto-merges by Renovate bot (#2197)
* chore: enable auto-merges by Renovate bot * validate renovate * Add renovate to CODEOWNERS
1 parent 58ab5b6 commit 3475f1c

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ RELEASED_VERSIONS.unsupported @stackrox/collector-team
1313
**/konflux.*Dockerfile @stackrox/rhtap-maintainers
1414
/.tekton/ @stackrox/rhtap-maintainers
1515
rpms.* @stackrox/rhtap-maintainers
16+
.github/renovate.json5 @stackrox/rhtap-maintainers

.github/renovate.json5

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,18 @@
7171
"dockerfile",
7272
"rpm",
7373
],
74+
"packageRules": [{
75+
"matchPackageNames": ["/.*/"],
76+
"groupName": "All updates",
77+
"automerge": true,
78+
// A known issue is that some non-Konflux CI jobs in currently fail, which may prevent successful auto-merging with a "branch" auto-merge setting.
79+
// Therefore, we use PR merge type and have automation approve PRs.
80+
"automergeType": "pr",
81+
"automergeStrategy": "squash",
82+
// Tell Renovate that it can automerge branches at any time of the day.
83+
"automergeSchedule": [
84+
"at any time"
85+
],
86+
}],
87+
"labels": ["auto-approve"],
7488
}

.github/workflows/auto-approve.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: auto-merge
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- labeled
7+
8+
jobs:
9+
auto-approve:
10+
name: Auto-approve Konflux updates
11+
runs-on: ubuntu-latest
12+
if: github.actor == 'red-hat-konflux[bot]' && github.event.label.name == 'auto-approve'
13+
steps:
14+
- env:
15+
GH_TOKEN: ${{ secrets.RHACS_BOT_GITHUB_TOKEN }}
16+
run: |
17+
set -euo pipefail
18+
gh pr review ${{ github.event.pull_request.number }} --approve --body "Auto-approved by automation."

0 commit comments

Comments
 (0)