Closed jamietanna closed 10 months ago
May be bale to do something like:
diff --git pkg/hooks/goreleaser.go pkg/hooks/goreleaser.go
index 8308c68..550c62e 100644
--- pkg/hooks/goreleaser.go
+++ pkg/hooks/goreleaser.go
@@ -67,6 +67,15 @@ func (gr *GoReleaser) Success(shConfig *hooks.SuccessHookConfig) error {
FullCommit: currentSha,
ShortCommit: currentSha,
}
+ isBreaking := false
+
+ for _, c := range shConfig.GetCommits() {
+ if c.Change.Major {
+ isBreaking = true
+ break
+ }
+ }
+ // TODO: set environment variable
repo := config.Repo{
Owner: shConfig.RepoInfo.Owner,
@@ -88,6 +97,7 @@ func (gr *GoReleaser) Success(shConfig *hooks.SuccessHookConfig) error {
ctx.Config.Release.NameTemplate = ctx.Git.CurrentTag
ctx.PreRelease = gr.prerelease
ctx.Config.Release.Draft = false // always disable drafts
+ ctx.Env["GOSEMREL_BREAKING"] = fmt.Sprintf("%t", isBreaking)
for _, pipe := range pipeline.Pipeline {
if _, ok := pipe.(git.Pipe); ok {
~This may not work if it's a v0 project, though :thinking:~
Thanks again for taking care of this. ☺️
You're welcome, thanks for a speedy release 🚀
Related to / duplicate of https://github.com/go-semantic-release/semantic-release/issues/171
How would it be possible to detect something within the release notes / a breaking change introduced? It appears that the
{{ .ReleaseNotes }}
variable for goreleaser has no value when using this hook.