-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (33 loc) · 1.04 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
31
32
33
34
35
36
37
38
39
name: Dependabot auto-merge
on:
pull_request:
merge_group:
permissions:
contents: read
pull-requests: read
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Dependabot metadata
id: dependabot_metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: ${{ steps.generate_token.outputs.token }}
- name: Authenticate cli
run: echo "${{ steps.generate_token.outputs.token }}" | gh auth login --with-token
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}