-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.63 KB
/
auto-merge-nonprod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Auto merge PR's (non-prod)
on:
pull_request:
branches-ignore:
# To disable the workflow:
- branchdoesntexist
# - prod
types:
- opened
- reopened
- labeled
- unlabeled
- edited
- synchronize
jobs:
automerge-nonprod:
name: Automerge [non-prod]
if: contains(github.event.pull_request.labels.*.name, 'auto merge')
runs-on: ubuntu-latest
steps:
- name: debug info
run: |
echo "PR: ${GITHUB_REF}"
echo "Branch: ${{ github.base_ref }}"
# If NOT on devel, wait for checks on SELF to finish:
- name: 'Wait for action suite'
if: github.event.pull_request.base.ref != 'devel'
uses: "WyriHaximus/[email protected]"
id: waitforstatuschecks
with:
checkInterval: 10
# Not sure exactly what this checks (conflicting answers), so just adding everything to debug:
ignoreActions: "Automerge [non-prod],Automerge [prod]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
# If something in the suite FAILED, break off now:
- name: 'Check success of action suite'
# special catch for devel, since it doesn't need to wait to merge
if: github.event.pull_request.base.ref != 'devel'
run: "[[ \"${{ steps.waitforstatuschecks.outputs.status }}\" == 'success' ]]"
# For all branches, merge the PR:
- name: 'Merge to Branch'
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: auto merge
UPDATE_LABELS: auto merge