Skip to content

Commit c167529

Browse files
authored
Merge pull request #5165 from nextcloud/backport/5150/stable28-automerge-renovate-prs
[stable28] enh(ci): set renovate PRs to auto merge
2 parents ee88bd3 + d3f0576 commit c167529

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
6+
name: Auto approve renovate PRs
7+
8+
on:
9+
pull_request_target:
10+
branches:
11+
- main
12+
- master
13+
- stable*
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: renovate-approve-merge-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
auto-approve-merge:
24+
if: github.actor == 'renovate[bot]'
25+
runs-on: ubuntu-latest
26+
permissions:
27+
# for hmarr/auto-approve-action to approve PRs
28+
pull-requests: write
29+
# for alexwilson/enable-github-automerge-action to approve PRs
30+
contents: write
31+
32+
steps:
33+
- uses: mdecoleman/pr-branch-name@bab4c71506bcd299fb350af63bb8e53f2940a599 # v2.0.0
34+
id: branchname
35+
with:
36+
repo-token: ${{ secrets.GITHUB_TOKEN }}
37+
38+
# GitHub actions bot approve
39+
- uses: hmarr/auto-approve-action@v3
40+
if: startsWith(steps.branchname.outputs.branch, 'renovate/')
41+
with:
42+
github-token: ${{ secrets.GITHUB_TOKEN }}
43+
44+
# Enable GitHub auto merge
45+
- name: Auto merge
46+
uses: alexwilson/enable-github-automerge-action@main
47+
if: startsWith(steps.branchname.outputs.branch, 'renovate/')
48+
with:
49+
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)