Documentation
README
CHANGELOG 自动生成
适用场景
在部署成功完成后自动生成或追加 CHANGELOG,记录本次发布的所有变更。适用于:
- 部署完成后的发布记录
- 版本发布前的变更汇总
- 对外发布说明的自动生成
核心方法
步骤 1:信息收集
-
Git 历史解析:
# 获取从上次 tag 到 HEAD 的所有提交 git log $(git describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD --pretty=format:"%H|%s|%an|%ai"- 如果没有 tag,取最近 50 条提交
- 解析 Conventional Commits 格式:
type(scope): description
-
Pipeline 产物读取:
.boss/<feature>/prd.md→ 功能描述和用户价值.boss/<feature>/deploy-report.md→ 部署环境和版本信息.boss/<feature>/tasks.md→ 完成的任务列表
-
版本号确定:
- 优先使用
package.json中的 version - 其次使用最新 git tag
- 如无法确定,使用日期格式
YYYY.MM.DD
- 优先使用
步骤 2:变更分类
按 Conventional Commits 规范分类:
This is the opening of the README. Read the full README on GitHub.