-
Notifications
You must be signed in to change notification settings - Fork 6
54 lines (47 loc) · 1.94 KB
/
auto-merge.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
51
52
53
54
name: Pull Requests auto-merge
on:
workflow_run:
workflows: ["Test and Measure"]
types:
- completed
permissions:
pull-requests: write
contents: write
# Cancel previous workflow run groups that have not completed.
concurrency:
# Group workflow runs by workflow name and branch name of pull request.
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
dependabot:
name: Dependabot PR auto-merge
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Approve and merge the PR
if: |
contains( github.event.workflow_run.head_commit.message, 'version-update:semver-minor' ) ||
contains( github.event.workflow_run.head_commit.message, 'version-update:semver-patch' )
run: gh pr merge "$PR_NUMBER" --auto --merge --delete-branch
env:
PR_NUMBER: ${{github.event.workflow_run.pull_requests[0].number}}
GITHUB_TOKEN: ${{secrets.GH_BOT_TOKEN}}
gutenberg-packages:
name: Gutenberg packages update PR auto-merge
runs-on: ubuntu-latest
if: ${{ github.actor == 'rtBot' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Approve and merge the PR
if: |
startsWith(github.event.workflow_run.head_commit.message, 'Update WordPress NPM packages based on Gutenberg release') &&
endsWith(github.event.workflow_run.head_commit.message, format('{0} {1}', 'rtBot', '<[email protected]>')) &&
github.event.workflow_run.head_commit.author.name == 'rtBot' &&
github.event.workflow_run.head_commit.author.email == '[email protected]'
run: gh pr merge "$PR_NUMBER" --auto --merge --delete-branch
env:
PR_NUMBER: ${{github.event.workflow_run.pull_requests[0].number}}
GITHUB_TOKEN: ${{secrets.GH_BOT_TOKEN}}