-
Notifications
You must be signed in to change notification settings - Fork 8
30 lines (30 loc) · 1.02 KB
/
automerge.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
name: automerge
on:
pull_request:
types:
- opened
- labeled
- ready_for_review
- reopened
- synchronize
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
automerge:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
if: contains(github.event.pull_request.labels.*.name, 'automerge') && github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Turn on automerge for this PR by Dependabot
if: github.actor == 'dependabot[bot]'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr merge --auto --squash ${{ github.event.pull_request.number }}
- name: Turn on automerge for this PR by users other than Dependabot
if: github.actor != 'dependabot[bot]'
env:
GH_TOKEN: ${{ secrets.TEAM_TF_CDK }}
run: gh pr merge --auto --squash ${{ github.event.pull_request.number }}