Skip to content

Commit c13e454

Browse files
authored
Create 99-auto-merge.yml (#142)
1 parent fd7d828 commit c13e454

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/99-auto-merge.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Dependabot auto-merge
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
dependabot:
8+
runs-on: ubuntu-24.04 # Use Ubuntu 24.04 explicitly
9+
if: ${{ github.actor == 'dependabot[bot]' }}
10+
steps:
11+
- name: ⏬ Dependabot metadata
12+
id: metadata
13+
uses: dependabot/fetch-metadata@v2
14+
with:
15+
github-token: "${{ secrets.GITHUB_TOKEN }}"
16+
17+
- name: ✔ Approve a PR
18+
run: gh pr review --approve "$PR_URL"
19+
env:
20+
PR_URL: ${{github.event.pull_request.html_url}}
21+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
22+
23+
- name: 🤖 Enable auto-merge for Dependabot PRs
24+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
25+
run: gh pr merge --auto --squash "$PR_URL"
26+
env:
27+
PR_URL: ${{github.event.pull_request.html_url}}
28+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)