Skip to content

Commit 5b4851f

Browse files
authored
Fix/dependabot improvements (#1562)
- Add auto-merge workflow for dependabot to actually update and merge PRs if the CI passes - Add grouping PRs to reduce the amount of PRs submitted by dependabot
1 parent 03b8381 commit 5b4851f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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: Debug info
14+
run: |
15+
echo "PR Actor: ${{ github.actor }}"
16+
echo "PR URL: ${{ github.event.pull_request.html_url }}"
17+
echo "PR Number: ${{ github.event.pull_request.number }}"
18+
19+
- name: Dependabot metadata
20+
id: metadata
21+
uses: dependabot/[email protected]
22+
with:
23+
github-token: "${{ secrets.GITHUB_TOKEN }}"
24+
25+
- name: Add labels to frontend dependency PRs
26+
run: |
27+
gh pr edit "$PR_URL" --add-label "dependency,automerge"
28+
env:
29+
PR_URL: ${{ github.event.pull_request.html_url }}
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Enable auto-merge for all dependency updates
33+
run: |
34+
echo "Enabling auto-merge for PR: $PR_URL"
35+
gh pr merge --auto --squash "$PR_URL"
36+
echo "Auto-merge enabled successfully"
37+
env:
38+
PR_URL: ${{ github.event.pull_request.html_url }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)