1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-08 03:31:59 +02:00
goreleaser/internal/client/release_notes.go
Carlos Alexandro Becker b8f61718f3
feat: allow to customize release notes update behavior (#2702)
* feat: allow to customize release notes update behavior

closes #1384

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* fix: make it a bit better

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* fix: jsonschema

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-11-26 09:59:15 -03:00

20 lines
452 B
Go

package client
import "github.com/goreleaser/goreleaser/pkg/config"
func getReleaseNotes(existing, current string, mode config.ReleaseNotesMode) string {
switch mode {
case config.ReleaseNotesModeAppend:
return existing + "\n\n" + current
case config.ReleaseNotesModeReplace:
return current
case config.ReleaseNotesModePrepend:
return current + "\n\n" + existing
default:
if existing != "" {
return existing
}
return current
}
}