File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -122,14 +122,15 @@ pipeline {
122122 else {
123123 echo " Release was triggered automatically"
124124
125- // Avoid doing an automatic release for commits from a release
126- def lastCommitter = sh(script : ' git show -s --format=\' %an\' ' , returnStdout : true ). trim()
127- def secondLastCommitter = sh(script : ' git show -s --format=\' %an\' HEAD~1' , returnStdout : true ). trim()
128- echo " Last two commits were performed by '${ lastCommitter} '/'${ secondLastCommitter} '."
129-
130- if (lastCommitter == ' Hibernate-CI' && secondLastCommitter == ' Hibernate-CI' ) {
131- print " INFO: Automatic release skipped because last commits were for the previous release"
132- currentBuild. result = ' ABORTED'
125+ // Avoid doing an automatic release if there are no "releasable" commits since the last release (see release scripts for determination)
126+ def releasableCommitCount = sh(
127+ script : " .release/scripts/count-releasable-commits.sh ${ env.PROJECT} " ,
128+ returnStdout : true
129+ ). trim(). toInteger()
130+ if ( releasableCommitCount <= 0 ) {
131+ print " INFO: Automatic release skipped because no releasable commits were pushed since the previous release"
132+ currentBuild. getRawBuild(). getExecutor(). interrupt(Result . NOT_BUILT )
133+ sleep(1 ) // Interrupt is not blocking and does not take effect immediately.
133134 return
134135 }
135136
You can’t perform that action at this time.
0 commit comments