1

In a Jenkins pipeline script, I am using the checkout function with class "GitSCM", as in the following example:

checkout(
   [
       $class: 'GitSCM', 
       branches: [[name: '*/<branche>']], 
       doGenerateSubmoduleConfigurations: false, 
       extensions: [], 
       submoduleCfg: [], 
       userRemoteConfigs: 
       [
           [credentialsId: '<id>', url: '<url>']
        ]
    ])

On the "Stage View)" for this pipeline, for each build, the Jenkins UI shows me the number of new commits since the previous build.

I would like to abort the build if there are 0 new commits. How should I do that? Is there a way to get that information from the checkout function?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.