Skip to content

Commit 3a42072

Browse files
committed
Create dependabot_auto_approve.yml
1 parent 3a077f7 commit 3a42072

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Dependabot Auto-Approve
2+
3+
on:
4+
pull_request_target: # Use pull_request_target to get write permissions for approval
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
10+
permissions:
11+
pull-requests: write # Needed to approve PRs
12+
13+
jobs:
14+
auto-approve:
15+
runs-on: ubuntu-latest
16+
# Only run for PRs authored by dependabot[bot]
17+
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot'
18+
steps:
19+
- name: Checkout code (not strictly necessary for just approval)
20+
uses: actions/checkout@v4
21+
# no further steps needed for just approval
22+
23+
- name: Auto-approve Dependabot PR
24+
run: |
25+
gh pr review --approve "$PR_URL"
26+
echo "Approved Dependabot PR: $PR_URL"
27+
env:
28+
GH_TOKEN: ${{ github.token }}
29+
PR_URL: ${{ github.event.pull_request.html_url }}

0 commit comments

Comments
 (0)