File tree 1 file changed +9
-2
lines changed 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -95,11 +95,18 @@ pipeline {
95
95
else {
96
96
echo " Release was triggered automatically"
97
97
98
- // Avoid doing a release for commits from a release
98
+ // Avoid doing an automatic release on a non-maintenance branch
99
+ if ( ! ( env. BRANCH_NAME ==~ / ^\d +\.\d +$/ ) ) {
100
+ print " INFO: Automatic release skipped because the branch name doesn't follow pattern /^\\ d+\\ .\\ d+\$ /"
101
+ currentBuild. result = ' ABORTED'
102
+ return
103
+ }
104
+
105
+ // Avoid doing an automatic release for commits from a release
99
106
def lastCommitter = sh(script : ' git show -s --format=\' %an\' ' , returnStdout : true )
100
107
def secondLastCommitter = sh(script : ' git show -s --format=\' %an\' HEAD~1' , returnStdout : true )
101
108
if (lastCommitter == ' Hibernate-CI' && secondLastCommitter == ' Hibernate-CI' ) {
102
- print " INFO: Build skipped because last commits were for the previous release"
109
+ print " INFO: Automatic release skipped because last commits were for the previous release"
103
110
currentBuild. result = ' ABORTED'
104
111
return
105
112
}
You can’t perform that action at this time.
0 commit comments