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 {
116
116
def releaseVersion
117
117
def developmentVersion
118
118
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
+
119
126
if ( manualRelease ) {
120
127
echo " Release was requested manually"
121
128
@@ -134,9 +141,8 @@ pipeline {
134
141
echo " Release was triggered automatically"
135
142
136
143
// 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) {
140
146
print " INFO: Automatic release skipped because last commits were for the previous release"
141
147
currentBuild. getRawBuild(). getExecutor(). interrupt(Result . NOT_BUILT )
142
148
sleep(1 ) // Interrupt is not blocking and does not take effect immediately.
You can’t perform that action at this time.
0 commit comments