-
-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (36 loc) · 1.42 KB
/
dependabot-review.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
name: Review Dependabot PRs
on:
pull_request_target:
branches: [main]
permissions:
pull-requests: write
contents: write
jobs:
review-dependabot-pr:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- uses: otto-de/purge-deprecated-workflow-runs@v2
with:
remove-obsolete: false
remove-skipped: |
${{ github.workflow }}
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/[email protected]
with:
alert-lookup: true
compat-lookup: true
skip-commit-verification: true
github-token: ${{ github.token }}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ github.token }}
- name: Approve patch and minor updates
if: ${{steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr review $PR_URL --approve -b "I'm **approving** this pull request because **it includes a patch or minor update**"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ github.token }}