Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- isPR = env.BRANCH_NAME ? env.BRANCH_NAME.startsWith("PR-") : false
- if (isPR) {
- checkout scm:[$class: 'GitSCM', userRemoteConfigs: [[ url: repoURL, credentialsId: gitCredentialId ]]]
- sh "git fetch origin pull/'${numberPR}'/head:'${BRANCH_NAME}'"
- sh "git checkout '${BRANCH_NAME}'"
- } else {
- checkout scm:[$class: 'GitSCM', userRemoteConfigs: [[ url: repoURL, credentialsId: gitCredentialId ]]]
- sh 'git checkout master'
- }
Add Comment
Please, Sign In to add comment