-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (41 loc) · 1.27 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
name: auto-merge
on:
pull_request:
types:
- opened # default
- synchronize # default
- reopened # default
- ready_for_review # draft -> ready
paths:
- "automatic-merge/**"
jobs:
auto-merge:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Approve Pull Request
uses: juliangruber/approve-pull-request-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: 2
- name: Get Pull Request Number
run: |
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
echo "pr: $PR_NUMBER"
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV"
- name: Approve Pull Request
uses: juliangruber/approve-pull-request-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ env.PR_NUMBER }}
- name: automerge
uses: pascalgn/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_METHOD: squash
MERGE_COMMIT_MESSAGE: pull-request-title
- uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: |
auto-merged