Skip to content

Commit 3f24f82

Browse files
committed
Merge branch 'master' into dev
2 parents c0e0797 + 65decfb commit 3f24f82

File tree

15 files changed

+804
-304
lines changed

15 files changed

+804
-304
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,23 @@
2121
<!--If merged, your code will serve tens of thousands of users! Please double-check the following items before submitting.-->
2222
<!--如果分支被合并,您的代码将服务于数万名用户!在提交前,请核查一下几点内容。-->
2323

24-
- [ ] 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
25-
- [ ] 👀 我的更改经过了良好的测试,**并已在上方提供了“验证步骤”和“运行截图”**。/ My changes have been well-tested, **and "Verification Steps" and "Screenshots" have been provided above**.
26-
- [ ] 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 `requirements.txt``pyproject.toml` 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in `requirements.txt` and `pyproject.toml`.
27-
- [ ] 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.
24+
- [ ] 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
25+
/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
26+
27+
- [ ] 👀 我的更改经过了良好的测试,**并已在上方提供了“验证步骤”和“运行截图”**
28+
/ My changes have been well-tested, **and "Verification Steps" and "Screenshots" have been provided above**.
29+
30+
- [ ] 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 `requirements.txt``pyproject.toml` 文件相应位置。
31+
/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in `requirements.txt` and `pyproject.toml`.
32+
33+
- [ ] 😮 我的更改没有引入恶意代码。
34+
/ My changes do not introduce malicious code.
35+
36+
- [ ] ⚠️ 我已认真阅读并理解以上所有内容,确保本次提交符合规范。
37+
/ I have read and understood all the above and confirm this PR follows the rules.
38+
39+
- [ ] 🚀 我确保本次开发**基于 dev 分支**,并将代码合并至**开发分支**(除非极其紧急,才允许合并到主分支)。
40+
/ I confirm that this development is **based on the dev branch** and will be merged into the **development branch**, unless it is extremely urgent to merge into the main branch.
41+
42+
- [ ] ⚠️ 我**没有**认真阅读以上内容,直接提交。
43+
/ I **did not** read the above carefully before submitting.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: PR Checklist Check
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, reopened, synchronize]
6+
7+
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
pull-requests: write
13+
issues: write
14+
15+
steps:
16+
- name: Check checklist
17+
id: check
18+
uses: actions/github-script@v7
19+
with:
20+
script: |
21+
const body = context.payload.pull_request.body || "";
22+
const regex = /-\s*\[\s*x\s*\].*没有.*认真阅读/i;
23+
const bad = regex.test(body);
24+
core.setOutput("bad", bad);
25+
26+
- name: Close PR
27+
if: steps.check.outputs.bad == 'true'
28+
uses: actions/github-script@v7
29+
with:
30+
script: |
31+
const pr = context.payload.pull_request;
32+
33+
await github.rest.issues.createComment({
34+
owner: context.repo.owner,
35+
repo: context.repo.repo,
36+
issue_number: pr.number,
37+
body: `检测到你勾选了“我没有认真阅读”,PR 已关闭。`
38+
});
39+
40+
await github.rest.pulls.update({
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
pull_number: pr.number,
44+
state: "closed"
45+
});

0 commit comments

Comments
 (0)