-
-
Notifications
You must be signed in to change notification settings - Fork 8
39 lines (39 loc) · 1.98 KB
/
dependabot-auto-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
38
39
name: Dependabot auto-merge
on: pull_request_target
permissions:
pull-requests: write
contents: write
jobs:
dependabot:
runs-on: ubuntu-latest
# Checking the actor will prevent your Action run failing on non-Dependabot PRs
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@5e5f99653a5b510e8555840e80cbf1514ad4af38 #2.1.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve Dependabot PR
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 for Dependabot PRs
if: |
(startsWith(steps.dependabot-metadata.outputs.dependency-names, 'catel.') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'fody') ||
endsWith(steps.dependabot-metadata.outputs.dependency-names, '.fody') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'microsoft.') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'nunit') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'nunit3testadapter') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'orc.') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'orchestra.') ||
startsWith(steps.dependabot-metadata.outputs.dependency-names, 'verify.')) &&
(steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor' ||
steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch')
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
PR_NUMBER: ${{github.event.pull_request.number}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}