As Mark mentioned, the alternative is to trigger an exception... (which 
will in turn show the row in red color).
I do it as follows. After checking out, if a git commit includes "[ci 
skip]" I use a "success" keyword (this keyword does not exit) hence the 
build stops.

I would love for this keyword to exist, so that the job will stop with a 
green row instead of a red row... Is this possible?

stage ("Checkout SCM") {
    steps {
        script {
           STAGE_NAME = "Checkout SCM"
               
           checkout scm
           result = sh (script: "git log -1 | grep '.*\\[ci skip\\].*'", 
returnStatus: true) 
           if (result == 0) {
              echo ("'ci skip' spotted in git commit. Aborting.")
              success ("'ci skip' spotted in git commit. Aborting.")
           }
        }
    }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/cd25bb36-d893-4281-a04e-d5a6bb54f6b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to