mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-06-14 01:11:30 +00:00
Change priority of the commit messages to follow the order:
Major version changes (breaking changes) Minor version changes (features) Release candidate changes Patch version changes (fixes)
This commit is contained in:
+18
-18
@@ -168,20 +168,14 @@ func (s *Setup) CalculateSemver() SemVer {
|
|||||||
matchMinor := checkMatches(commitSlice, s.Wording.Minor)
|
matchMinor := checkMatches(commitSlice, s.Wording.Minor)
|
||||||
matchMajor := checkMatches(commitSlice, s.Wording.Major)
|
matchMajor := checkMatches(commitSlice, s.Wording.Major)
|
||||||
matchReleaseCandidate := checkMatches(commitSlice, s.Wording.Release)
|
matchReleaseCandidate := checkMatches(commitSlice, s.Wording.Release)
|
||||||
if matchPatch {
|
if matchMajor {
|
||||||
s.Semver.Patch++
|
s.Semver.Major++
|
||||||
logger.Debug(&libpack_logger.LogMessage{
|
s.Semver.Minor = 0
|
||||||
Message: "Incrementing patch (WORDING)",
|
|
||||||
Pairs: map[string]interface{}{"commit": strings.TrimSuffix(commit.Message, "\n"), "semver": s.getSemver()},
|
|
||||||
})
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if matchReleaseCandidate {
|
|
||||||
s.Semver.Release++
|
|
||||||
s.Semver.Patch = 1
|
s.Semver.Patch = 1
|
||||||
s.Semver.EnableReleaseCandidate = true
|
s.Semver.EnableReleaseCandidate = false
|
||||||
|
s.Semver.Release = 0
|
||||||
logger.Debug(&libpack_logger.LogMessage{
|
logger.Debug(&libpack_logger.LogMessage{
|
||||||
Message: "Incrementing release candidate (WORDING)",
|
Message: "Incrementing major (WORDING)",
|
||||||
Pairs: map[string]interface{}{"commit": strings.TrimSuffix(commit.Message, "\n"), "semver": s.getSemver()},
|
Pairs: map[string]interface{}{"commit": strings.TrimSuffix(commit.Message, "\n"), "semver": s.getSemver()},
|
||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
@@ -197,14 +191,20 @@ func (s *Setup) CalculateSemver() SemVer {
|
|||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if matchMajor {
|
if matchReleaseCandidate {
|
||||||
s.Semver.Major++
|
s.Semver.Release++
|
||||||
s.Semver.Minor = 0
|
|
||||||
s.Semver.Patch = 1
|
s.Semver.Patch = 1
|
||||||
s.Semver.EnableReleaseCandidate = false
|
s.Semver.EnableReleaseCandidate = true
|
||||||
s.Semver.Release = 0
|
|
||||||
logger.Debug(&libpack_logger.LogMessage{
|
logger.Debug(&libpack_logger.LogMessage{
|
||||||
Message: "Incrementing major (WORDING)",
|
Message: "Incrementing release candidate (WORDING)",
|
||||||
|
Pairs: map[string]interface{}{"commit": strings.TrimSuffix(commit.Message, "\n"), "semver": s.getSemver()},
|
||||||
|
})
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if matchPatch {
|
||||||
|
s.Semver.Patch++
|
||||||
|
logger.Debug(&libpack_logger.LogMessage{
|
||||||
|
Message: "Incrementing patch (WORDING)",
|
||||||
Pairs: map[string]interface{}{"commit": strings.TrimSuffix(commit.Message, "\n"), "semver": s.getSemver()},
|
Pairs: map[string]interface{}{"commit": strings.TrimSuffix(commit.Message, "\n"), "semver": s.getSemver()},
|
||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user