-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (30 loc) · 1.04 KB
/
dependabot-merge.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
name: Dependabot Pull Request Approve and Merge
on:
pull_request_target:
permissions:
pull-requests: write
contents: write
jobs:
dependabot:
name: Dependabot Pull Request Approve and Merge
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Retrieve Dependabot Pull Request Metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.6.0
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Approve Dependabot Pull Request
run: |
gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable Auto Merge Dependabot Pull Request
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
gh pr merge --auto --rebase "$PR_URL"