Skip to content

Commit 03eb817

Browse files
committed
ci: :trollface: 优化下
1 parent f0ad780 commit 03eb817

2 files changed

Lines changed: 8 additions & 81 deletions

File tree

.github/workflows/ChinaGodMan.yml.off

Lines changed: 0 additions & 65 deletions
This file was deleted.

.github/workflows/pr-merge-dependabot.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,15 @@ jobs:
1010
runs-on: ubuntu-latest
1111
if: github.actor == 'dependabot[bot]'
1212
steps:
13-
- name: Checkout code 👋
14-
uses: actions/checkout@v6
15-
1613
- name: Check and merge ⛙
1714
uses: actions/github-script@v8
1815
with:
1916
github-token: ${{ secrets.QWY_SYNC_BOT_TOKEN }}
2017
script: |
2118
const { repo: { owner, repo } } = context;
2219
const pr = context.payload.pull_request;
23-
24-
// 1. 仅处理 Dependabot 提交的 PR
25-
if (pr.user.login !== 'dependabot[bot]') {
26-
console.log('不是 Dependabot 提交的 PR,跳过处理');
27-
return;
28-
}
29-
30-
// 2. 尝试合并 PR
3120
try {
3221
console.log(`尝试合并 PR: ${pr.html_url}`);
33-
const commitTitle= `${pr.title} (#${pr.number})`;
34-
const commitMessage = "Signed-off-by: dependabot[bot] <support@github.com>";
35-
console.log(`提交信息: ${commitTitle}`);
3622
//批准PR
3723
await github.rest.pulls.createReview({
3824
owner,
@@ -47,8 +33,8 @@ jobs:
4733
repo,
4834
pull_number: pr.number,
4935
merge_method: "squash", // 挤压合并
50-
commit_title: commitTitle,
51-
commit_message: commitMessage,
36+
commit_title: undefined,
37+
commit_message: '',
5238
});
5339
5440
} catch (error) {
@@ -95,4 +81,10 @@ jobs:
9581
pull_number: pr.number,
9682
state: 'open',
9783
});
84+
await github.rest.issues.createComment({
85+
issue_number: pr.number,
86+
owner: owner,
87+
repo: repo,
88+
body: '@dependabot recreate'
89+
});
9890
}

0 commit comments

Comments
 (0)