mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-02-08 18:57:03 +00:00
refactor: move commit analyzing out of forge
This commit is contained in:
parent
f2a982d7a0
commit
5882a6bf2c
11 changed files with 152 additions and 188 deletions
16
changelog.go
16
changelog.go
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue