Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit f440850

Browse files
authored
Add workflow for auto-merging Dependabot updates
1 parent 60022d7 commit f440850

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Auto-merge dependabot updates
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
permissions:
8+
pull-requests: write
9+
contents: write
10+
11+
jobs:
12+
dependabot-merge:
13+
runs-on: ubuntu-latest
14+
if: ${{ github.actor == 'dependabot[bot]' }}
15+
steps:
16+
- name: Dependabot metadata
17+
id: metadata
18+
uses: dependabot/fetch-metadata@v2.4.0
19+
with:
20+
github-token: "${{ secrets.GITHUB_TOKEN }}"
21+
22+
- name: Enable auto-merge for Dependabot PRs
23+
# Only if version bump is not a major version change
24+
if: ${{steps.metadata.outputs.update-type != 'version-update:semver-major'}}
25+
run: gh pr merge --auto --merge "$PR_URL"
26+
env:
27+
PR_URL: ${{github.event.pull_request.html_url}}
28+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)