resolveScm cannot lookup Folder credentials

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The resolveScm step does not find folder credentials. The step does not fail, rather it tries to fetch sources as anonymous.

      • Create a credentials at root with ID my-creds-in-root
      • Create the same credentials inside a folder with ID my-creds-in-folder
      • Create a Multibranch project where you have a branch with a pipeline like the following:
      pipeline {
          agent any
          
          stages {
              stage('test') {
                  steps {
                      resolveScm(source: [$class: 'GitSCMSource', credentialsId: 'my-creds-in-root', id: '_', remote: 'https://github.com/privateowner/repo.git', traits: [gitBranchDiscovery()]], targets: ['main'])
                      resolveScm(source: [$class: 'GitSCMSource', credentialsId: 'my-creds-in-folder', id: '_', remote: 'https://github.com/privateowner/repo.git', traits: [gitBranchDiscovery()]], targets: ['main'])
                  }
              }
          }
      }
      
      • You should see that the first one works, the second one fails (and the git log shows that no credentials it used)

      Note: This can be reproduced with different SCM Source implementation:

            Assignee:
            Unassigned
            Reporter:
            Allan BURDAJEWICZ
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: