-
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@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Dependabot metadata
id: dependabot_metadata
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 # v2.3.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 }}