mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-08 03:31:59 +02:00
b8f61718f3
* 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>
20 lines
452 B
Go
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
|
|
}
|
|
}
|