File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments