-
-
Save aslafy-z/adb007ff50896fa5f87eef1cddf5060e to your computer and use it in GitHub Desktop.
Jenkins [skip ci] implementation for multi-branch declarative pipeline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
... | |
stages { | |
stage('Run CI?') { | |
steps { | |
script { | |
if (sh(script: "git log -1 --pretty=%B | grep -F -ie '[skip ci]' -e '[ci skip]'", returnStatus: true) == 0) { | |
currentBuild.result = 'NOT_BUILT' | |
error 'Aborting because commit message contains [skip ci]' | |
} | |
} | |
} | |
} | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment