-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 1.07 KB
/
dependabot-automerge.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
name: Auto-merge Dependabot PR
on:
pull_request:
branches: [master]
permissions:
contents: read
pull-requests: read
jobs:
dependabot-pr:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
# if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@78e5f2ddc08efcb88fbbee6cfa3fed770ba550c3 # v1.9.1
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Dependabot metadata
id: dependabot_metadata
uses: dependabot/fetch-metadata@c9c4182bf1b97f5224aee3906fd373f6b61b4526 # v1.6.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Authenticate cli
run: echo "${{ steps.generate_token.outputs.token }}" | gh auth login --with-token
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --merge --auto "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}