Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Jenkins [skip ci] implementation for multi-branch declarative pipeline
// change 'agent' lines as appropriate
pipeline {
agent none
stages {
stage('Run CI?') {
agent any
steps {
script {
if (sh(script: "git log -1 --pretty=%B | fgrep -ie '[skip ci]' -e '[ci skip]'", returnStatus: true) == 0) {
currentBuild.result = 'NOT_BUILT'
error 'Aborting because commit message contains [skip ci]'
}
}
}
}
stage('next stage') {
agent { dockerfile true }
steps {
echo 'next stage here...'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment