forked from solana-labs/governance-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (30 loc) · 1.02 KB
/
depbot.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
name: Dependabot Auto-merger
on: pull_request_target
permissions:
pull-requests: write
contents: write
jobs:
dependabot:
runs-on: ubuntu-latest
# Only run on bot PRs
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
# Fails if no metadata
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.3.0
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
# Approves PRs
- name: Approve PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Auto-merge patch and minor updates if all checks pass
- name: Auto-merge Dependabot PRs
if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}