Skip to content

Commit 3651f0d

Browse files
authored
backport(release-3.21): Renovate bot auto-merge (#2227)
* backport: Renovate bot auto-merge * add additional labels
1 parent 3d9e591 commit 3651f0d

File tree

3 files changed

+40
-4
lines changed

3 files changed

+40
-4
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
RELEASED_VERSIONS @stackrox/collector-team
99
RELEASED_VERSIONS.unsupported @stackrox/collector-team
1010

11-
# The RHTAP maintainers for ACS review all changes related to the Konflux (f.k.a. RHTAP) pipelines, such as new
11+
# The RHTAP maintainers for ACS review all changes related to the Konflux pipelines, such as new
1212
# pipelines, parameter changes or automated task updates as well as Dockerfile updates.
13-
**/konflux.*Dockerfile @stackrox/rhtap-maintainers
14-
/.tekton/ @stackrox/rhtap-maintainers
15-
rpms.* @stackrox/rhtap-maintainers
13+
# rhacs-bot auto-approves MintMaker PRs for automated task and security updates.
14+
**/konflux.*Dockerfile @stackrox/rhtap-maintainers @rhacs-bot
15+
/.tekton/ @stackrox/rhtap-maintainers @rhacs-bot
16+
rpms.* @stackrox/rhtap-maintainers @rhacs-bot
17+
.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", "build-builder-image","rebuild-test-container"],
7488
}

.github/workflows/auto-approve.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 }} \
19+
--approve --body "Auto-approved by automation." \
20+
--repo "${{ github.repository }}"

0 commit comments

Comments
 (0)