-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.17 KB
/
auto-merge.yaml
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
name: auto-merge
on:
pull_request:
types:
- opened
jobs:
auto-merge:
runs-on: ubuntu-latest
timeout-minutes: 3
permissions:
contents: write
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Generate token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.MY_APP_ID }}
private_key: ${{ secrets.MY_APP_PRIVATE_KEY }}
id: my_app
- name: Fetch metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: ${{ steps.my_app.outputs.token }}
id: metadata
- name: Approve
id: approve
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ steps.my_app.outputs.token }}
- name: Merge
if: ${{ steps.approve.conclusion == 'success' }}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ steps.my_app.outputs.token }}