Is there a command to know the targeted branch name of a PR when building this PR?
Context:
I am building some code with a "Multibranch Pipeline" jenkins job.
When I create a Github Pull request, this job is triggered and I would like to know, in this job execution, what is the targeted branch name of this PR.
I have tried different commands in my Jenkinsfile but none are giving me the expected result.
If I try this: git rev-parse --abbrev-ref HEAD
it gives me: HEAD
If a execute: git branch
I get: * (HEAD detached at 464f73c0)
What I want to get is, for instance, master
if the PR is targeting master as destination branch.
Any idea ?
Thanks for your help