Skip to content

Commit dcef2d3

Browse files
chitcommitNick Bianchiclaude
authored
ci: add dependabot auto-merge for minor/patch updates (#34)
Automatically approves and enables auto-merge on dependabot PRs for semver minor and patch version bumps when CI passes. Major version bumps still require manual review. Co-authored-by: Nick Bianchi <nick@jeanarlene.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent db80f1b commit dcef2d3

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)