You've already forked go-semantic-release
fix(pkg/semanticrelease): remove check for branch prefix for releases
This commit is contained in:
@@ -2,7 +2,6 @@ package semanticrelease
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Masterminds/semver"
|
"github.com/Masterminds/semver"
|
||||||
@@ -98,14 +97,21 @@ func (s *SemanticRelease) GetNextVersion(provider *ci.ProviderConfig, force bool
|
|||||||
analyzedCommits := s.analyzer.Analyze(commits)
|
analyzedCommits := s.analyzer.Analyze(commits)
|
||||||
|
|
||||||
var newVersion semver.Version
|
var newVersion semver.Version
|
||||||
|
foundBranchConfig := false
|
||||||
for branch, releaseType := range s.config.Branch {
|
for branch, releaseType := range s.config.Branch {
|
||||||
if provider.Branch == branch || strings.HasPrefix(provider.Branch, branch) {
|
if provider.Branch == branch {
|
||||||
log.Debugf("Found branch config for branch %s with release type %s", provider.Branch, releaseType)
|
log.Debugf("Found branch config for branch %s with release type %s", provider.Branch, releaseType)
|
||||||
newVersion = s.calculator.CalculateNewVersion(analyzedCommits, lastVersion, releaseType, firstRelease)
|
newVersion = s.calculator.CalculateNewVersion(analyzedCommits, lastVersion, releaseType, firstRelease)
|
||||||
|
foundBranchConfig = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !foundBranchConfig {
|
||||||
|
log.Warnf("No branch config found for branch %s, will return last known version", provider.Branch)
|
||||||
|
newVersion = *lastVersion
|
||||||
|
}
|
||||||
|
|
||||||
releaseVersion := shared.ReleaseVersion{
|
releaseVersion := shared.ReleaseVersion{
|
||||||
Next: shared.ReleaseVersionEntry{
|
Next: shared.ReleaseVersionEntry{
|
||||||
Commit: provider.Commit,
|
Commit: provider.Commit,
|
||||||
|
|||||||
Reference in New Issue
Block a user