feat(analyzer): add 'DRAFT' as messeage identifier

This commit is contained in:
Felix Wiedmann
2019-06-20 00:46:59 +02:00
parent e4ba4834eb
commit 849dc6c5b7
4 changed files with 39 additions and 16 deletions

View File

@@ -100,7 +100,7 @@ func (s *SemanticRelease) GetNextVersion(force bool) (*shared.ReleaseVersion, er
return nil, err
}
result := a.Analyze(commits)
var isDraft bool = false
for branch, releaseType := range s.config.Branch {
if currentBranch == branch || strings.HasPrefix(currentBranch, branch) {
log.Debugf("Found branch config for branch %s with release type %s", currentBranch, releaseType)
@@ -115,6 +115,9 @@ func (s *SemanticRelease) GetNextVersion(force bool) (*shared.ReleaseVersion, er
} else if len(result["patch"]) > 0 {
newVersion = newVersion.IncPatch()
}
if len(result["draft"]) > 0 {
isDraft = true
}
}
}
}
@@ -123,6 +126,7 @@ func (s *SemanticRelease) GetNextVersion(force bool) (*shared.ReleaseVersion, er
Next: shared.ReleaseVersionEntry{
Commit: hash,
Version: &newVersion,
Draft: isDraft,
},
Last: shared.ReleaseVersionEntry{
Commit: lastVersionHash,