Skip to content

Commit 8398fb0

Browse files
committed
Add dependabot auto-approve workflow
1 parent 30ae62c commit 8398fb0

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Dependabot PR Approval and Merge
2+
# This workflow automatically approves and merges pull requests created by Dependabot.
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
dependabot:
23+
needs: [ build ] # <-- important!
24+
runs-on: ubuntu-latest
25+
permissions:
26+
pull-requests: write
27+
contents: write
28+
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
29+
steps:
30+
- id: metadata
31+
uses: dependabot/fetch-metadata@v2
32+
with:
33+
github-token: "${{ secrets.GITHUB_TOKEN }}"
34+
- run: |
35+
gh pr merge --squash --auto "$PR_URL"
36+
env:
37+
PR_URL: ${{github.event.pull_request.html_url}}
38+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)