Skip to content

Commit b5626b2

Browse files
authored
chore(ci)!: update issue CI configuration [skip ci] (#2166)
1 parent 795a18b commit b5626b2

File tree

5 files changed

+58
-18
lines changed

5 files changed

+58
-18
lines changed

.github/ISSUE_TEMPLATE/00-bug_report_zh.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body:
1313
attributes:
1414
label: 请确认以下事项
1515
description: |
16-
您必须阅读并检查以下内容,否则您的问题一定会被直接关闭。
16+
您必须阅读、检查、确认、同意以下内容,否则您的问题一定会被直接关闭。
1717
或者您可以去[讨论区](https://github.com/OpenListTeam/OpenList/discussions)。
1818
options:
1919
- label: |
@@ -35,8 +35,7 @@ body:
3535
- label: |
3636
我已确认这个问题在最新版本中没有被修复。
3737
- label: |
38-
我没有阅读这个清单,只是闭眼选中了所有的复选框,请关闭这个 Issue
39-
38+
我没有阅读这个清单,只是闭眼选中了所有的复选框,请关闭这个 Issue 。
4039
- type: input
4140
id: version
4241
attributes:

.github/ISSUE_TEMPLATE/01-bug_report_en.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body:
1313
attributes:
1414
label: Please confirm the following
1515
description: |
16-
You must read and check all the following, otherwise your issue will definitely be closed directly.
16+
You must read, check, confirm, and agree to all the following, otherwise your issue will definitely be closed directly.
1717
Or you can go to the [discussions](https://github.com/OpenListTeam/OpenList/discussions).
1818
options:
1919
- label: |
@@ -35,8 +35,7 @@ body:
3535
- label: |
3636
I confirm this issue is not fixed in the latest version.
3737
- label: |
38-
I have not read these checkboxes and therefore I just ticked them all, Please close this issue
39-
38+
I have not read these checkboxes and therefore I just ticked them all, Please close this issue.
4039
- type: input
4140
id: version
4241
attributes:

.github/ISSUE_TEMPLATE/02-feature_request_zh.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ body:
77
attributes:
88
label: 请确认以下事项
99
description: |
10-
您必须勾选以下内容,否则您的问题可能会被直接关闭。
10+
您必须阅读、检查、确认、同意以下内容,否则您的问题可能会被直接关闭。
1111
或者您可以去[讨论区](https://github.com/OpenListTeam/OpenList/discussions)。
1212
options:
1313
- label: |
@@ -28,6 +28,8 @@ body:
2828
我已确认此功能尚未被实现。
2929
- label: |
3030
我已确认此功能是合理的,且有普遍需求,并非我个人需要。
31+
- label: |
32+
我没有阅读这个清单,只是闭眼选中了所有的复选框,请关闭这个 Issue 。
3133
- type: textarea
3234
id: feature-description
3335
attributes:

.github/ISSUE_TEMPLATE/03-feature_request_en.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: "Feature Request"
22
description: Feature Request / Enhancement
3-
title: "[Feature] Please change the title to your feature name"
3+
title: "[Feature] Please modify the title to your feature name"
44
labels: [enhancement]
55
body:
66
- type: checkboxes
77
attributes:
88
label: Please confirm the following
99
description: |
10-
You must check all the following, otherwise your request may be closed directly.
10+
You must read, check, confirm, and agree to all the following, otherwise your request may be closed directly.
1111
Or you can go to the [discussions](https://github.com/OpenListTeam/OpenList/discussions).
1212
options:
1313
- label: |
@@ -28,6 +28,8 @@ body:
2828
I confirm this feature has not been implemented yet.
2929
- label: |
3030
I confirm this feature is reasonable and has general demand, not just my personal need.
31+
- label: |
32+
I have not read these checkboxes and therefore I just ticked them all, Please close this issue.
3133
- type: textarea
3234
id: feature-description
3335
attributes:

.github/workflows/issue_pr_comment.yml

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,62 @@ jobs:
1919
uses: actions/github-script@v7
2020
with:
2121
script: |
22+
let comment = "";
23+
const issueTitle = context.payload.issue.title || "";
24+
const titleNotEdited = /(请修改标题|Please modify the title)/i.test(issueTitle);
25+
if (titleNotEdited) {
26+
comment = "⚠️ 请修改标题以更好地描述您的问题或需求,并删除示例提示。当前 Issue 将被自动关闭。如需继续提交,请创建新的 Issue。\n";
27+
comment += "⚠️ Please modify the title to better describe your issue or request, and remove the example prompt. This issue will be automatically closed. If you wish to proceed, please create a new issue.\n";
28+
await github.rest.issues.createComment({
29+
...context.repo,
30+
issue_number: context.issue.number,
31+
body: comment
32+
});
33+
await github.rest.issues.update({
34+
...context.repo,
35+
issue_number: context.issue.number,
36+
state: 'closed',
37+
state_reason: 'not_planned',
38+
labels: ['invalid']
39+
});
40+
return;
41+
}
2242
const issueBody = context.payload.issue.body || "";
23-
const unchecked = /- \[ \] (?!我没有阅读这个清单|I have not read these checkboxes)/.test(issueBody);
24-
let comment = "感谢您联系OpenList。我们会尽快回复您。\n";
25-
comment += "Thanks for contacting OpenList. We will reply to you as soon as possible.\n\n";
26-
if (unchecked) {
43+
const confirmHasRead = /- \[ \] (?!我没有阅读这个清单|I have not read these checkboxes)/.test(issueBody);
44+
const confirmNotRead = /- \[[xX]\] (?:我没有阅读这个清单|I have not read these checkboxes)/.test(issueBody);
45+
if (confirmNotRead) {
46+
comment = "⚠️ 你的 Issue 不符合提交规则。请先阅读相关规范后再重新提交。当前 Issue 将被自动关闭。如需继续提交,请确认已了解规则后重新打开或创建新的 Issue。\n";
47+
comment += "⚠️ Your issue does not comply with the submission rules. Please read the guidelines before submitting again. This issue will be automatically closed. If you wish to proceed, please confirm that you have reviewed the rules before reopening or creating a new issue.\n";
48+
await github.rest.issues.createComment({
49+
...context.repo,
50+
issue_number: context.issue.number,
51+
body: comment
52+
});
53+
await github.rest.issues.update({
54+
...context.repo,
55+
issue_number: context.issue.number,
56+
state: 'closed',
57+
state_reason: 'not_planned',
58+
labels: ['invalid']
59+
});
60+
return;
61+
}
62+
if (confirmHasRead) {
63+
comment = "感谢您联系OpenList。我们会尽快回复您。\n";
64+
comment += "Thanks for contacting OpenList. We will reply to you as soon as possible.\n\n";
2765
comment += "由于您提出的 Issue 中包含部分未确认的项目,为了更好地管理项目,在人工审核后可能会直接关闭此问题。\n";
2866
comment += "如果您能确认并补充相关未确认项目的信息,欢迎随时重新提交。我们会及时关注并处理。感谢您的理解与支持!\n";
2967
comment += "Since your issue contains some unchecked tasks, it may be closed after manual review.\n";
3068
comment += "If you can confirm and provide information for the unchecked tasks, feel free to resubmit.\n";
3169
comment += "We will pay attention and handle it in a timely manner.\n\n";
3270
comment += "感谢您的理解与支持!\n";
3371
comment += "Thank you for your understanding and support!\n";
72+
await github.rest.issues.createComment({
73+
...context.repo,
74+
issue_number: context.issue.number,
75+
body: comment
76+
});
3477
}
35-
await github.rest.issues.createComment({
36-
...context.repo,
37-
issue_number: context.issue.number,
38-
body: comment
39-
});
4078
4179
pr-title-check:
4280
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)