-
Notifications
You must be signed in to change notification settings - Fork 63
40 lines (34 loc) · 1.33 KB
/
dependabot.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
40
# Automatically approve and merge dependabot PRs.
name: Dependabot
on:
pull_request:
branches: ["*"]
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token
permissions:
issues: write
pull-requests: write
jobs:
approve:
name: Approve Dependabot PRs
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- uses: octokit/[email protected]
if: contains(fromJSON('["opened", "reopened"]'), github.event.action)
with:
route: POST /repos/{owner_and_repo}/pulls/{pull_number}/reviews
owner_and_repo: ${{ github.repository }}
pull_number: ${{ github.event.pull_request.number }}
event: "APPROVE"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: octokit/[email protected]
if: contains(fromJSON('["opened", "reopened"]'), github.event.action)
with:
route: POST /repos/{owner_and_repo}/issues/{pull_number}/comments
owner_and_repo: ${{ github.repository }}
pull_number: ${{ github.event.pull_request.number }}
# two quotes are needed to avoid a syntax error when running the action
body: "'@dependabot squash and merge'"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}