In this case, since you're inside a pipeline that is running, I don't think that you want to scan all branches. I think that you want to use the branch that was already determined by the multibranch pipeline that started the job. So long as you are inside a multibranch pipeline, the settings for the
On Fri, Oct 16, 2020 at 6:07 AM 'Joel Ng' via Jenkins Users < [email protected]> wrote: > > This is my checkout command: > scmVars = checkout scm: [ > $class: 'GitSCM', > userRemoteConfigs: [[credentialsId: "${GIT_CREDENTIALS}", url: > "${GIT_URL}"]] > ] > > scmVars = checkout scm: [ $class: 'GitSCM', branches: scm.branches, userRemoteConfigs: scm.userRemoteConfigs ] There is an example here <https://github.com/MarkEWaite/jenkins-bugs/blob/87b0c4ef172a8741cb530a4bb5f5ebe253d8185e/Jenkinsfile#L14> if you'd like to see something more in context. > This repository has no "master" branch, it only has a "development" branch. > > From the docs ( > https://www.jenkins.io/doc/pipeline/steps/workflow-scm-step/) it says > that leaving the branch empty means it will scan all branches, so I was > expecting it to checkout the "development" branch. But it seems to be > attempting to grab the "master" branch. Why is that? > > Thanks in advance! > Regards, > Joel > > -- > 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/3a1c8643-b888-4576-a7fa-45b6bda50d36n%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/3a1c8643-b888-4576-a7fa-45b6bda50d36n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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/CAO49JtHxwrtDgedJyBU0XinUK2W00k%2Bb%2BSz1p393o4kEsLRAqg%40mail.gmail.com.
