Skip to content

Commit

Permalink
Merge pull request #99 from boxboat/bugfix/prepare-promotions-tag-prefix
Browse files Browse the repository at this point in the history
Properly handle gitTagPrefix in preparePromotions method
  • Loading branch information
matthewdevenny authored Dec 4, 2023
2 parents 1b6afd2 + 59352b2 commit 4054e5d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/com/boxboat/jenkins/pipeline/promote/BoxPromote.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,17 @@ class BoxPromote extends BoxBase<PromoteConfig> implements Serializable {
setVersionChange(gitCommitToTag, gitTagToTag)

if (gitCommitToTag) {
commits = gitRepo.getCommitsBetween(nextSemVer.getPreviousVersion(), gitCommitToTag)
if (config.gitTagPrefix) {
commits = gitRepo.getCommitsBetween("${config.gitTagPrefix}${nextSemVer.getPreviousVersion()}", gitCommitToTag)
} else {
commits = gitRepo.getCommitsBetween(nextSemVer.getPreviousVersion(), gitCommitToTag)
}
} else if (gitTagToTag) {
commits = gitRepo.getCommitsBetween(nextSemVer.getPreviousVersion(), gitTagToTag)
if (config.gitTagPrefix) {
commits = gitRepo.getCommitsBetween("${config.gitTagPrefix}${nextSemVer.getPreviousVersion()}", "${config.gitTagPrefix}${gitTagToTag}")
} else {
commits = gitRepo.getCommitsBetween(nextSemVer.getPreviousVersion(), gitTagToTag)
}
}
}

Expand Down

0 comments on commit 4054e5d

Please sign in to comment.