Skip to content

Commit a46f4cf

Browse files
authored
chore(pr auto reply ci): Update PR title validation and feedback messages (#559)
Update PR title validation and feedback messages Improves the PR title regex to be non-greedy and adds 'chore' to the allowed prefixes. Enhances feedback comments with clearer instructions in both Chinese and English, including guidance for PRs spanning multiple components.
1 parent 8eb2d60 commit a46f4cf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/issue_pr_comment.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ jobs:
4747
with:
4848
script: |
4949
const title = context.payload.pull_request.title || "";
50-
const ok = /^(feat|docs|fix|style|refactor|chore)\(.+\): /i.test(title);
50+
const ok = /^(feat|docs|fix|style|refactor|chore)\(.+?\): /i.test(title);
5151
if (!ok) {
52-
let comment = "⚠️ PR 标题需以 `feat(): `, `docs(): `, `fix(): `, `style(): `, `refactor(): ` 其中之一开头,例如:`feat(component): 新增功能`。";
53-
comment += "⚠️ The PR title must start with `feat(): `, `docs(): `, `fix(): `, `style(): `, or `refactor(): `. For example: `feat(component): add new feature`.\n\n";
52+
let comment = "⚠️ PR 标题需以 `feat(): `, `docs(): `, `fix(): `, `style(): `, `refactor(): `, `chore(): ` 其中之一开头,例如:`feat(component): 新增功能`。\n";
53+
comment += "⚠️ The PR title must start with `feat(): `, `docs(): `, `fix(): `, `style(): `, or `refactor(): `, `chore(): `. For example: `feat(component): add new feature`.\n\n";
54+
comment += "如果跨多个组件,请使用主要组件作为前缀,并在标题中枚举、描述中说明。\n";
55+
comment += "If it spans multiple components, use the main component as the prefix and enumerate in the title, describe in the body.\n\n";
5456
await github.rest.issues.createComment({
5557
...context.repo,
5658
issue_number: context.issue.number,

0 commit comments

Comments
 (0)