feat(changelog): omit version heading in forge release notes

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 14:00:30 +02:00 committed by GitHub
parent 997b6492de
commit 2621c48d75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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
}