-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set the the value of GIT_BRANCH when kicking off builds #170
Conversation
Super valuable! |
This is already set by ${ghprbSourceBranch}, is there any reason to add another variable? |
If you set GIT_BRANCH, then I can use GIT_BRANCH when I rewrite the build name in the log. Most of the environment variables aren't normally available in the "set branch name" option. |
Setting |
@intel352 I didn't think of that, good point. I actually did try to refer to ghprbSourceBranch when building, I found the name of that variable when I was making this change in particular. I found that it didn't work properly which is why I went back and added this one. |
Does the git plugin also set this value? If so, then will it be overriding the value when the build is started by ghprb? I am not familiar with the process is why I ask. |
There are two places that the git plugin sets that variable. For my current build it is set as detached when using ghprb |
The git plugin tries to set this value before GhprbTrigger.startJob is invoked. We're overriding it. And obviously we're getting a detached head because a pull request commit isn't actually contained in any branch. Potentially we could detect the detached state and only override in that case, though I am inclined to say that there's not really any circumstance that the git plugin will have more correct information than we do about what branch is being built. |
Man, this is the reason I love github. I thought this pull request would get no activity, and we're here having a conversation about it a month later and it's still relevant. |
Set the the value of GIT_BRANCH when kicking off builds
WooT |
Allows users to refer to the original branch name when rewriting build descriptors by using ${GIT_BRANCH}