Skip to content

Commit 230f7b7

Browse files
committed
ci: add Dependabot auto-merge workflow for patch and minor bumps
1 parent 81fb3f4 commit 230f7b7

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Dependabot auto-merge
2+
3+
on: pull_request
4+
5+
permissions:
6+
contents: write
7+
pull-requests: write
8+
9+
jobs:
10+
auto-merge:
11+
if: github.actor == 'dependabot[bot]'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Fetch Dependabot metadata
15+
id: meta
16+
uses: dependabot/fetch-metadata@v2
17+
- name: Auto-approve patch and minor bumps
18+
if: steps.meta.outputs.update-type == 'version-update:semver-patch' || steps.meta.outputs.update-type == 'version-update:semver-minor'
19+
run: gh pr review --approve "$PR_URL"
20+
env:
21+
PR_URL: ${{ github.event.pull_request.html_url }}
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
- name: Enable auto-merge for patch and minor bumps
24+
if: steps.meta.outputs.update-type == 'version-update:semver-patch' || steps.meta.outputs.update-type == 'version-update:semver-minor'
25+
run: gh pr merge --auto --squash --delete-branch "$PR_URL"
26+
env:
27+
PR_URL: ${{ github.event.pull_request.html_url }}
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)