-
-
Notifications
You must be signed in to change notification settings - Fork 23
24 lines (22 loc) · 899 Bytes
/
Copy pathautomerge-dependabot-prs.yaml
File metadata and controls
24 lines (22 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
name: Dependabot auto-approve
on: pull_request_target
permissions:
contents: write
pull-requests: write
jobs:
dependabot:
name: 'Dependabot'
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event.pull_request.user.login == 'dependabot[bot]'}}
steps:
- name: Approve PR
run: gh pr review "$PR_URL" --approve --body "Auto-approving this PR as it was opened by Dependabot"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
# if: ${{ github.event.pull_request.mergeable == true && github.event.pull_request.mergeable_state == 'clean' }}
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}