Skip to content

Commit 6861cb4

Browse files
authored
chore(ci): add breaking change guideline to PR title check (OpenListTeam#2087)
* feat(ci): add PR title validation for breaking changes Updated regex to allow '!' for breaking changes in PR titles. Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> * chore(pr): Update PR template Add bilingual instructions for PR title formatting. Signed-off-by: MadDogOwner <xiaoran@xrgzs.top> --------- Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
1 parent 5d9fc83 commit 6861cb4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
Provide a general summary of your changes in the Title above.
33
The PR title must start with `feat(): `, `docs(): `, `fix(): `, `style(): `, or `refactor(): `, `chore(): `. For example: `feat(component): add new feature`.
44
If it spans multiple components, use the main component as the prefix and enumerate in the title, describe in the body.
5+
For breaking changes, add `!` after the type, e.g., `feat(component)!: breaking change`.
56
-->
67
<!--
78
在上方标题中提供您更改的总体摘要。
89
PR 标题需以 `feat(): `, `docs(): `, `fix(): `, `style(): `, `refactor(): `, `chore(): ` 其中之一开头,例如:`feat(component): 新增功能`。
910
如果跨多个组件,请使用主要组件作为前缀,并在标题中枚举、描述中说明。
11+
如果是破坏性变更,请在类型后添加 `!`,例如 `feat(component)!: 破坏性变更`。
1012
-->
1113

1214
## Description / 描述

.github/workflows/issue_pr_comment.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ 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) {
5252
let comment = "⚠️ PR 标题需以 `feat(): `, `docs(): `, `fix(): `, `style(): `, `refactor(): `, `chore(): ` 其中之一开头,例如:`feat(component): 新增功能`。\n";
5353
comment += "⚠️ The PR title must start with `feat(): `, `docs(): `, `fix(): `, `style(): `, or `refactor(): `, `chore(): `. For example: `feat(component): add new feature`.\n\n";
5454
comment += "如果跨多个组件,请使用主要组件作为前缀,并在标题中枚举、描述中说明。\n";
5555
comment += "If it spans multiple components, use the main component as the prefix and enumerate in the title, describe in the body.\n\n";
56+
comment += "如果是破坏性变更,请在类型后添加 `!`,例如 `feat(component)!: 破坏性变更`。\n";
57+
comment += "For breaking changes, add `!` after the type, e.g., `feat(component)!: breaking change`.\n\n";
5658
await github.rest.issues.createComment({
5759
...context.repo,
5860
issue_number: context.issue.number,

0 commit comments

Comments
 (0)