feat(changelog): remove heading in forge release description

The forge ui usually shows the release name right above the description,
so this removes an unecessary duplicate bit of information.

In addition this also cleans up the changelog interface a bit and moves
functionality where it belongs. Prepares a bit for custom changelogs in
the future.

Closes #32
This commit is contained in:
Julian Tölle 2024-09-22 13:51:16 +02:00
parent 997b6492de
commit 00f7226c10
5 changed files with 71 additions and 34 deletions

View file

@ -15,3 +15,18 @@ type AnalyzedCommit struct {
Scope *string
BreakingChange bool
}
// ByType groups the Commits by the type field. Used by the Changelog.
func ByType(in []AnalyzedCommit) map[string][]AnalyzedCommit {
out := map[string][]AnalyzedCommit{}
for _, commit := range in {
if out[commit.Type] == nil {
out[commit.Type] = make([]AnalyzedCommit, 0, 1)
}
out[commit.Type] = append(out[commit.Type], commit)
}
return out
}