refactor: move commit analyzing out of forge

This commit is contained in:
Julian Tölle 2024-08-17 16:26:40 +02:00
parent f2a982d7a0
commit 5882a6bf2c
11 changed files with 152 additions and 188 deletions

View file

@ -90,18 +90,16 @@ func UpdateChangelogFile(wt *git.Worktree, newEntry string) error {
return nil
}
func NewChangelogEntry(changesets []Changeset, version, link, prefix, suffix string) (string, error) {
func NewChangelogEntry(commits []AnalyzedCommit, version, link, prefix, suffix string) (string, error) {
features := make([]AnalyzedCommit, 0)
fixes := make([]AnalyzedCommit, 0)
for _, changeset := range changesets {
for _, commit := range changeset.ChangelogEntries {
switch commit.Type {
case "feat":
features = append(features, commit)
case "fix":
fixes = append(fixes, commit)
}
for _, commit := range commits {
switch commit.Type {
case "feat":
features = append(features, commit)
case "fix":
fixes = append(fixes, commit)
}
}