8000 Test the ci-commiter before checking the release type (manual/automatic) · hibernate/hibernate-orm@4246f43 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4246f43

Browse files
marko-bekhtabeikov
authored andcommitted
Test the ci-commiter before checking the release type (manual/automatic)
1 parent 4076e63 commit 4246f43

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ci/release/Jenkinsfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ pipeline {
116116
def releaseVersion
117117
def developmentVersion
118118

119+
def lastCommitter = sh(script: 'git show -s --format=\'%an\'', returnStdout: true).trim()
120+
def secondLastCommitter = sh(script: 'git show -s --format=\'%an\' HEAD~1', returnStdout: true).trim()
121+
def isCiLastCommiter = lastCommitter == 'Hibernate-CI' && secondLastCommitter == 'Hibernate-CI'
122+
123+
echo "Last two commits were performed by '${lastCommitter}'/'${secondLastCommitter}'."
124+
echo "Is 'Hibernate-CI' the last commiter: '${isCiLastCommiter}'."
125+
119126
if ( manualRelease ) {
120127
echo "Release was requested manually"
121128

@@ -134,9 +141,8 @@ pipeline {
134141
echo "Release was triggered automatically"
135142

136143
// Avoid doing an automatic release for commits from a release
137-
def lastCommitter = sh(script: 'git show -s --format=\'%an\'', returnStdout: true)
138-
def secondLastCommitter = sh(script: 'git show -s --format=\'%an\' HEAD~1', returnStdout: true)
139-
if (lastCommitter == 'Hibernate-CI' && secondLastCommitter == 'Hibernate-CI') {
144+
145+
if (isCiLastCommiter) {
140146
print "INFO: Automatic release skipped because last commits were for the previous release"
141147
currentBuild.getRawBuild().getExecutor().interrupt(Result.NOT_BUILT)
142148
sleep(1) // Interrupt is not blocking and does not take effect immediately.

0 commit comments

Comments
 (0)
0