Skip to content

feat(ci): allow conventional PR title prefixes#8665

Open
SunmiJJW wants to merge 2 commits into
AstrBotDevs:masterfrom
SunmiJJW:feat/pr-title-conventional-prefixes
Open

feat(ci): allow conventional PR title prefixes#8665
SunmiJJW wants to merge 2 commits into
AstrBotDevs:masterfrom
SunmiJJW:feat/pr-title-conventional-prefixes

Conversation

@SunmiJJW

@SunmiJJW SunmiJJW commented Jun 8, 2026

Copy link
Copy Markdown

Modifications / 改动点

This PR aligns the PR title workflow with the repository's CONTRIBUTING guide.

本 PR 将 PR 标题检查 workflow 与仓库 CONTRIBUTING 中的语义化标题规则对齐。

  • Allow common Conventional Commit prefixes in .github/workflows/pr-title-check.yml: feat, fix, docs, style, refactor, perf, test, chore, ci, build, and revert.
  • Update the failure comment and error message so contributors see the accepted formats.
  • Keep the existing feat: xxx and feat(scope): xxx behavior working.
  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

Verification:

node -e 'const allowedTypes="feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert"; const pattern=new RegExp("^("+allowedTypes+")(\\([a-z0-9-]+\\))?:\\s.+$","i"); const good=["feat: add thing","fix(core): handle thing","chore: bump deps","perf(provider): reduce calls","Revert: previous change"]; const bad=["update thing","fix(scope) missing colon","feat(scope) : extra space","fix:"]; for (const t of good) if (!pattern.test(t)) throw new Error("expected pass: "+t); for (const t of bad) if (pattern.test(t)) throw new Error("expected fail: "+t); console.log("ok pr-title pattern cases passed");'
ok pr-title pattern cases passed

git diff --check
# no whitespace errors

Duplicate check:

gh pr list --repo AstrBotDevs/AstrBot --state open --limit 100 --json number,title,files,url
# No open PR among the first 100 modifies .github/workflows/pr-title-check.yml.

Checklist / 检查清单

  • 😊 No user-facing feature is added; this checklist item is N/A.
    / 未新增面向用户的功能;此项不适用。

  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”

  • 🤓 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.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Align the PR title validation workflow with the repository's Conventional Commit-style title rules.

Enhancements:

  • Improve PR title failure messages to clearly document the required Conventional Commit formats and allowed prefixes.

CI:

  • Expand the PR title check workflow to accept common Conventional Commit prefixes (feat, fix, docs, style, refactor, perf, test, chore, ci, build, revert).

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 8, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The failure comment currently shows feat: xxx, fix(scope): xxx, and chore: xxx; consider including both scoped and unscoped examples for at least one type (e.g. feat: xxx and feat(scope): xxx) to make the expected pattern for the optional scope clearer to contributors.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The failure comment currently shows `feat: xxx`, `fix(scope): xxx`, and `chore: xxx`; consider including both scoped and unscoped examples for at least one type (e.g. `feat: xxx` and `feat(scope): xxx`) to make the expected pattern for the optional scope clearer to contributors.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant