Release Drafter 支持 scoped conventional commits —— 实施方案
基于 README.md 制定。
0x01 现状
autolabeler 9 条 title 规则均使用 /^{type}: .*/ 格式,不支持 feat(xxx)、build(deps) 等符合 {type}({scope}) 的模式。2 条 body 规则不受影响。
0x02 方案
将 9 条 title 正则统一改为 /^{type}(\\([^)]+\\))?: .*/,scope 部分可选。
以 build 为例:/^build: .*/ → /^build(\\([^)]+\\))?: .*/
([^)]+)而非(.*):scope 仅匹配非)字符且至少一个字符,避免贪婪匹配越界和空括号()- YAML 中括号需双重转义:正则
\(→ YAML\\(
0x03 实施步骤
- 在
ci/260222_release_log分支修改.github/release-drafter-config.yml的 autolabeler 部分 - 提交:
ci: support scoped conventional commits in release-drafter autolabeler - 推送分支,创建 PR 到
main
制定日期:2026-02-22