fix(prerelease): calculate right version if branch is set to alpha,beta or rc

This commit is contained in:
Nightapes
2020-01-26 17:08:57 +01:00
parent 6a375f3bab
commit c361744a35
5 changed files with 82 additions and 56 deletions

View File

@@ -15,19 +15,19 @@ import (
)
const defaultCommitList string = `{{ range $index,$commit := .BreakingChanges -}}
{{ if eq $index 0 }}
{{ if eq $index 0 -}}
## BREAKING CHANGES
{{ end}}
{{ end -}}
* {{ if $commit.Scope }}**{{$.Backtick}}{{$commit.Scope}}{{$.Backtick}}**{{ end }} {{$commit.ParsedBreakingChangeMessage}}
introduced by commit:
{{$commit.ParsedMessage}} {{if $.HasURL}} ([{{ printf "%.7s" $commit.Commit.Hash}}]({{ replace $.URL "{{hash}}" $commit.Commit.Hash}})){{end}}
{{ end -}}
{{ range $key := .Order }}
{{ range $key := .Order -}}
{{ $commits := index $.Commits $key -}}
{{ if $commits }}
{{ if $commits -}}
### {{ $key }}
{{ range $index,$commit := $commits }}
* {{ if $commit.Scope}}**{{$.Backtick}}{{$commit.Scope}}{{$.Backtick}}** {{end}}{{$commit.ParsedMessage}}{{if $.HasURL}} ([{{ printf "%.7s" $commit.Commit.Hash}}]({{ replace $.URL "{{hash}}" $commit.Commit.Hash}})){{end}}
{{ range $index,$commit := $commits -}}
* {{ if $commit.Scope }}**{{$.Backtick}}{{$commit.Scope}}{{$.Backtick}}** {{end}}{{$commit.ParsedMessage}}{{if $.HasURL}} ([{{ printf "%.7s" $commit.Commit.Hash}}]({{ replace $.URL "{{hash}}" $commit.Commit.Hash}})){{end}}
{{ end -}}
{{ end -}}
{{ end -}}`