Skip to content

Commit cfab587

Browse files
authored
Merge pull request #456 from nextcloud/nickvergessen-patch-1
Create update-nextcloud-ocp-approve-merge.yml
2 parents 12da2e7 + 1bd8613 commit cfab587

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
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 nextcloud/ocp
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: update-nextcloud-ocp-approve-merge-${{ github.head_ref || github.run_id }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
auto-approve-merge:
24+
if: github.actor == 'nextcloud-command'
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@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
40+
if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp')
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@f3e77fa17ba5a11771671361c01f382322c6db03 # main
47+
if: startsWith(steps.branchname.outputs.branch, 'automated/noid/') && endsWith(steps.branchname.outputs.branch, 'update-nextcloud-ocp')
48+
with:
49+
github-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)