-
-
Notifications
You must be signed in to change notification settings - Fork 5
38 lines (36 loc) · 1.59 KB
/
auto-approve-imgbot.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
name: Auto approve and merge PRs by imgbot
# Trigger the workflow on pull request
on:
pull_request
jobs:
autoapprove:
name: Auto Approve a PR by imgbot # Name of the job
runs-on: ubuntu-latest # Environment on which the job runs
steps:
- name: Auto approve imgbot
uses: hmarr/auto-approve-action@v2.0.0 # Custom action for auto approval already available on marketplace
# Perform the auto approve action only when the PR is raised by imgbot
if: github.actor == 'imgbot[bot]' || github.actor == 'ImgBot[bot]'
with:
# Create a personal access token and store it under the Secrets section of the particular repository
# with the key "ACTIONS_TOKEN"
github-token: ${{ secrets.ACTIONS_TOKEN }}
automerge:
name: Auto merge after successful checks
# By default, jobs run in parallel. To run the jobs sequentially, they keywords "needs" is needed.
# Auto merge action can be done only when the PR is approved, hence this automerge needs autoapprove as a prerequisite
needs: autoapprove
runs-on: ubuntu-latest
steps:
- id: automerge
name: Auto merge
# Custom action for auto merging already available on marketplace
uses: "pascalgn/automerge-action@v0.16.3"
# Perform the auto merge action only when the PR is raised by imgbot
if: github.actor == 'imgbot[bot]' || github.actor == 'ImgBot[bot]'
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
MERGE_METHOD: rebase
UPDATE_LABEL: ""
MERGE_LABELS: "!x"
MERGE_ERROR_FAIL: "true"