1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-02-05 13:15:11 +02:00

feat(cmd/changelog): add chore group (#1217)

This commit is contained in:
包子 2021-07-20 17:38:56 +08:00 committed by GitHub
parent dba4b4007d
commit 5559923193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,6 +132,7 @@ func ParseCommitsInfo(info []CommitInfo) string {
"feat": {},
"deps": {},
"break": {},
"chore": {},
"other": {},
}
@ -141,9 +142,10 @@ func ParseCommitsInfo(info []CommitInfo) string {
if index != -1 {
msg = msg[:index-1]
}
prefix := []string{"fix", "feat", "deps", "break"}
prefix := []string{"fix", "feat", "deps", "break", "chore"}
var matched bool
for _, v := range prefix {
msg = strings.TrimPrefix(msg, " ")
if strings.HasPrefix(msg, v) {
group[v] = append(group[v], msg)
matched = true
@ -166,6 +168,8 @@ func ParseCommitsInfo(info []CommitInfo) string {
text = "### New Features\n"
case "fix":
text = "### Bug Fixes\n"
case "chore":
text = "### Chores\n"
case "other":
text = "### Others\n"
}
@ -176,7 +180,7 @@ func ParseCommitsInfo(info []CommitInfo) string {
}
}
}
return fmt.Sprint(md["break"], md["deps"], md["feat"], md["fix"], md["other"])
return fmt.Sprint(md["break"], md["deps"], md["feat"], md["fix"], md["chore"], md["other"])
}
func ParseReleaseInfo(info ReleaseInfo) string {