Skip to content

Commit 81d7dfd

Browse files
committed
feat: 配置 Dependabot 自动合并所有依赖更新
1 parent 2547b44 commit 81d7dfd

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ updates:
1010
patterns: ["*"]
1111
- package-ecosystem: "npm"
1212
directory: "/"
13-
schedule: { interval: "daily", time: "04:05" }
13+
schedule:
14+
interval: "weekly"
15+
time: "04:05" # Keeping the original time, but changing interval to weekly
1416
open-pull-requests-limit: 10
1517
labels: ["dependencies", "npm"]
1618
versioning-strategy: "increase"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Dependabot Auto-Merge
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
auto-merge:
13+
runs-on: ubuntu-latest
14+
if: github.actor == 'dependabot[bot]'
15+
steps:
16+
- name: Dependabot metadata
17+
id: metadata
18+
uses: dependabot/fetch-metadata@v2
19+
with:
20+
github-token: "${{ secrets.GITHUB_TOKEN }}"
21+
22+
- name: Enable auto-merge for Dependabot PRs
23+
run: gh pr merge --auto --squash "$PR_URL"
24+
env:
25+
PR_URL: ${{ github.event.pull_request.html_url }}
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Approve PR
29+
run: gh pr review --approve "$PR_URL"
30+
env:
31+
PR_URL: ${{ github.event.pull_request.html_url }}
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)