Allow skip with [ci skip] marker in tag message
This commit is contained in:
parent
297ead2d7e
commit
0bef6cf450
|
@ -46,6 +46,26 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
stage("Check [ci skip] in tag message") {
|
||||
steps {
|
||||
script {
|
||||
dir(env.projectDir) {
|
||||
sh 'git checkout "${packageBranch}"'
|
||||
def commitTags = sh(script: 'git describe --exact-match --abbrev=0', returnStdout: true).split(' ')
|
||||
for (tag in commitTags) {
|
||||
tag = tag.trim()
|
||||
def tagMessage = sh(script: "git tag --format='%(subject)' -l '${tag}'", returnStdout: true).trim()
|
||||
println("Tag '${tag}' message is: '${tagMessage}'")
|
||||
if (tagMessage.contains('[ci skip]')) {
|
||||
currentBuild.result = 'ABORTED'
|
||||
error("Le message du tag '${tag}' contient le marqueur '[ci-skip]' !")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage("Checkout ref") {
|
||||
steps {
|
||||
dir(env.projectDir) {
|
||||
|
|
Loading…
Reference in New Issue