Tried using
checkout scm: [$class: 'GitSCM',
userRemoteConfigs: [[url: '${repoURL}']],
branches: [[name: 'refs/tags/${tag-version}']]],poll: false
This fails with an Authentication error. Is there any way other than using
withCredentials
to checkout tag in a Jenkinsfile
After spending, hours got here
Correct way to use GitSCM in declarative pipeline is
checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: repoURL, credentialsId: credential]], branches: [[name: tag-version]]],poll: false
Not like I found in most places in web
checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: repoURL], [credentialsId: credential]], branches: [[name: tag-version]]],poll: false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With