-
Notifications
You must be signed in to change notification settings - Fork 23
33 lines (30 loc) · 1.19 KB
/
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
name: "Dependabot auto-merge"
# Temporarily disabling for pull requests
# on: pull_request
on: workflow_dispatch
permissions:
contents: read
jobs:
dependabot:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 # v2.3.0
with:
github-token: "${{ secrets.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: ${{ secrets.GITHUB_TOKEN }}
- name: Approve Dependabot PRs (only semver patch updates and dev/indirect deps)
if: ${{ (steps.metadata.outputs.dependency-type == 'direct:development' || steps.metadata.outputs.dependency-type == 'indirect') && steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}