Skip to content

Commit b795f80

Browse files
更新 pr-checklist-check.yml
1 parent bc3b5e5 commit b795f80

1 file changed

Lines changed: 2 additions & 40 deletions

File tree

.github/workflows/pr-checklist-check.yml

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
const bad = regex.test(body);
2424
core.setOutput("bad", bad);
2525
26-
- name: Close PR if checklist violated
26+
- name: Close PR
2727
if: steps.check.outputs.bad == 'true'
2828
uses: actions/github-script@v7
2929
with:
@@ -42,42 +42,4 @@ jobs:
4242
repo: context.repo.repo,
4343
pull_number: pr.number,
4444
state: "closed"
45-
});
46-
47-
- name: Check target branch
48-
uses: actions/github-script@v7
49-
with:
50-
script: |
51-
const pr = context.payload.pull_request;
52-
const base = pr.base.ref;
53-
54-
if (base !== "dev") {
55-
await github.rest.issues.createComment({
56-
owner: context.repo.owner,
57-
repo: context.repo.repo,
58-
issue_number: pr.number,
59-
body: `⚠️ 当前 PR 的 **目标分支是 \`${base}\`**。
60-
61-
建议将 PR 合并到 **\`dev\` 分支(开发分支)**,这样通常可以 **更快被合并**。
62-
63-
除非你的 PR **非常紧急**,否则请不要直接提交到 **\`master\` 分支**。`
64-
});
65-
}
66-
67-
- name: Check source branch
68-
uses: actions/github-script@v7
69-
with:
70-
script: |
71-
const pr = context.payload.pull_request;
72-
const head = pr.head.ref;
73-
74-
if (head !== "dev") {
75-
await github.rest.issues.createComment({
76-
owner: context.repo.owner,
77-
repo: context.repo.repo,
78-
issue_number: pr.number,
79-
body: `💡 当前 PR 的 **源分支是 \`${head}\`**。
80-
81-
建议 **基于 \`dev\` 分支进行开发**,并及时从 \`dev\` 拉取更新,这样可以显著减少 **合并冲突的可能性**。`
82-
});
83-
}
45+
});

0 commit comments

Comments
 (0)