given that I am using the pipeline plugin + the entire github plugin is installed in jenkins, I struggled to check the current pull request, which caused the job in the pipeline script as follows:
node('master') {
stage 'Checkout'
checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: [[name: "origin/????"]], doGenerateSubmoduleConfigurations: false, submoduleCfg: [], userRemoteConfigs: [[name: 'origin', url: 'git@github.com/project.git', credentialsId: 'github-id']]]
}
but I did not find a way to get the current request request branch from any env variable, maybe this is not the case to check the branch called?
source
share