Skip to content

Commit 47aecb6

Browse files
authored
Add Dependabot auto-merge workflow
1 parent 3cd9833 commit 47aecb6

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Dependabot Auto-Merge
2+
on: pull_request_target
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.actor == 'dependabot[bot]' }}
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@v2
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
19+
# Approve and auto-merge the PR
20+
- name: Approve and merge
21+
run: |
22+
gh pr review --approve "$PR_URL"
23+
gh pr merge --auto --squash "$PR_URL"
24+
env:
25+
PR_URL: ${{ github.event.pull_request.html_url }}
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)