Jenkins GitHub pull request builder - get branch name for shell

I use the Jenkins GitHub pull builder plugin to run my unit tests when a tensile request is created using a web hook. For the build phase, I need to know the name of the branch that merges (for example, I need to develop the branch if it merges into the main branch). Is there a way to access this in the Jenkins runtime shell? Thank,

+4
source share
1 answer

Your link has an answer:

Environment Variables

The plugin provides very useful environment variables.

  • ghprbActualCommit

  • ghprbActualCommitAuthor

  • ghprbActualCommitAuthorEmail

  • ghprbPullDescription

  • ghprbPullId

  • ghprbPullLink

  • ghprbPullTitle

  • ghprbSourceBranch

  • ghprbTargetBranch

  • sha1

$ghprbSourceBranch, , - script.

+5

All Articles