How to checkout ssh remote in github organization Jenkins workflow and use ssh credentials in Jenkinsfile
I have a Github Organisation item in jenkins. On the root of my repository, my Jenkinsfile looks something like this: node { def jenkinsCredsId = 'xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbbbb' stage 'Checkout' checkout scm // I also tried the following: // checkout scm: [$class: 'GitSCM', source: 'ssh://git@github.com:MY_ORGANISATION/jenkins-testing-temp.git', clean: true, credentialsId: jenkinsCredsId] stage 'Build' // generate some artefact (dist.zip) stage 'Release' sshagent([jenkinsCredsId]) { sh ''' git remote -v // show remotes ssh-add -l // show currently loaded ssh keys fingerprints git fetch