I have a Jenkins job where I'm checking out 2 repos, The first repo "dev" contains src code and the Jenkinsfile and this repo is configured in Jenkins UI along with PollScm enabled. The second repo is "devops", I'm checking out this repo with sparse checkout in groovy script declarative pipeline.
stage('Checkout DevopsScripts') {
steps {
script{
dir('devops'){
def scmVar = checkout([$class: 'GitSCM', \
branches: [[name: '*/master']], \
doGenerateSubmoduleConfigurations: false, \
extensions: [[$class: 'SparseCheckoutPaths', sparseCheckoutPaths:[[$class:'SparseCheckoutPath', path:'Scripts/testScript/']]]], \
submoduleCfg: [], \
userRemoteConfigs: [[credentialsId: 'XXXXXXX', url: "https://github.com/org/devops.git"]], \
poll: false, \
changelog: false
])
}
}
}
}
Now I want PollScm to happen only for the commits happening in the "dev" repo, PollScm should ignore commits happening in "devops" repo. But even after enabling poll: false Jenkins job triggers on any commits happening in either repo. I have scrolled through the document "https://plugins.jenkins.io/workflow-scm-step/" which says "You may specify poll: false to disable polling for an SCM checkout" which is not happening in my case. Is there a bug in Jenkins related to this issue or I'm missing anything here.