Jenkins GitHub拉取请求生成器-获取执行Shell的分支名称 [英] Jenkins GitHub pull request builder - get branch name for execute shell
问题描述
I am using Jenkins GitHub pull request builder plugin for running my unit tests when a pull request is made vis a vis a web hook. For the build step, I need to know the name of the branch that is being merged in (e.g. I need develop branch if merging that into master branch). Is there a way to get access to this in the Jenkins execute shell? Thanks,
推荐答案
您的链接具有答案:
该插件提供了一些非常有用的环境变量。
The plugin makes some very useful environment variables available.
-
ghprbActualCommit
ghprbActualCommit
ghprbActualCommitAuthor
ghprbActualCommitAuthor
ghprbActualCommitAuthorEmail
ghprbActualCommitAuthorEmail
ghprbPullDescription
ghprbPullDescription
ghprbPullId
ghprbPullId
ghprbPullLink
ghprbPullLink
ghprbPullTitle
ghprbPullTitle
ghprbSourceBranch
ghprbSourceBranch
ghprbTargetBranch
ghprbTargetBranch
sha1
您将要使用 $ ghprbSourceBranch
来获取值在脚本中其他位置构建的分支。
You'll want to use $ghprbSourceBranch
to get the value of the branch being built somewhere else in your script.
这篇关于Jenkins GitHub拉取请求生成器-获取执行Shell的分支名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!