feat: only add type of change in CHANGELOG when there is changed

main
hau 2020-11-10 17:59:15 +07:00
parent 16bf3ab92a
commit b30c90f3e5
5 changed files with 19 additions and 19 deletions

View File

@ -70,14 +70,20 @@ func (g *MarkdownGenerator) getLines(commits []convention.Commit) []string {
}
}
lines = append(lines, g.composeTypeHeader(addedType))
lines = append(lines, addedLines...)
if len(addedLines) != 0 {
lines = append(lines, g.composeTypeHeader(addedType))
lines = append(lines, addedLines...)
}
lines = append(lines, g.composeTypeHeader(fixedType))
lines = append(lines, fixedLines...)
if len(fixedLines) != 0 {
lines = append(lines, g.composeTypeHeader(fixedType))
lines = append(lines, fixedLines...)
}
lines = append(lines, g.composeTypeHeader(othersType))
lines = append(lines, othersLines...)
if len(othersLines) != 0 {
lines = append(lines, g.composeTypeHeader(othersType))
lines = append(lines, othersLines...)
}
return lines
}

View File

@ -2,7 +2,5 @@
"# CHANGELOG",
"## v1.0.0 (1-1-1)",
"### Added",
"* feat: description",
"### Fixed",
"### Others"
"- feat: description"
]

View File

@ -1,8 +1,6 @@
[
"# CHANGELOG",
"## v1.0.0 (1-1-1)",
"### Added",
"### Fixed",
"* fix: description",
"### Others"
"- fix: description"
]

View File

@ -1,8 +1,6 @@
[
"# CHANGELOG",
"## v1.0.0 (1-1-1)",
"### Added",
"### Fixed",
"### Others",
"* ci: description"
"- ci: description"
]

View File

@ -2,10 +2,10 @@
"# CHANGELOG",
"## v1.0.0 (1-1-1)",
"### Added",
"* feat: description feat",
"- feat: description feat",
"### Fixed",
"* fix: description fix",
"- fix: description fix",
"### Others",
"* ci: description ci",
"* build: description build"
"- ci: description ci",
"- build: description build"
]