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 @@ -115,6 +115,13 @@ pipeline {
115115 def releaseVersion
116116 def developmentVersion
117117
118+ def lastCommitter = sh(script : ' git show -s --format=\' %an\' ' , returnStdout : true ). trim()
119+ def secondLastCommitter = sh(script : ' git show -s --format=\' %an\' HEAD~1' , returnStdout : true ). trim()
120+ def isCiLastCommiter = lastCommitter == ' Hibernate-CI' && secondLastCommitter == ' Hibernate-CI'
121+
122+ echo " Last two commits were performed by '${ lastCommitter} '/'${ secondLastCommitter} '."
123+ echo " Is 'Hibernate-CI' the last commiter: '${ isCiLastCommiter} '."
124+
118125 if ( manualRelease ) {
119126 echo " Release was requested manually"
120127
@@ -133,9 +140,8 @@ pipeline {
133140 echo " Release was triggered automatically"
134141
135142 // Avoid doing an automatic release for commits from a release
136- def lastCommitter = sh(script : ' git show -s --format=\' %an\' ' , returnStdout : true )
137- def secondLastCommitter = sh(script : ' git show -s --format=\' %an\' HEAD~1' , returnStdout : true )
138- if (lastCommitter == ' Hibernate-CI' && secondLastCommitter == ' Hibernate-CI' ) {
143+
144+ if (isCiLastCommiter) {
139145 print " INFO: Automatic release skipped because last commits were for the previous release"
140146 currentBuild. getRawBuild(). getExecutor(). interrupt(Result . NOT_BUILT )
141147 sleep(1 ) // Interrupt is not blocking and does not take effect immediately.
You can’t perform that action at this time.
0 commit comments