-
Notifications
You must be signed in to change notification settings - Fork 43
34 lines (27 loc) · 1.06 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
# Automatically merge non-functional Dependabot updates, which means anything but Castle.Core.
# All dependencies other than Castle.Core are either test frameworks or style/quality libraries.
name: Auto merge
on: pull_request
permissions:
contents: write
pull-requests: write
jobs:
dependabot-auto-merge:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Approve PR
if: contains(steps.metadata.outputs.dependency-names, 'Castle.Core') == false
run: gh pr review --approve "${{ github.event.pull_request.html_url }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge
if: contains(steps.metadata.outputs.dependency-names, 'Castle.Core') == false
run: gh pr merge --auto --merge "${{ github.event.pull_request.html_url }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}