Jenkins GitHub pull request builder - 获取执行shell的分支名称

i_t*_*ope 4 continuous-integration github jenkins ghprb

我正在使用Jenkins GitHub拉请求构建器插件来运行我的单元测试,当对Web钩子发出拉取请求时.对于构建步骤,我需要知道正在合并的分支的名称(例如,如果将其合并到master分支中,我需要开发分支).有没有办法在Jenkins执行shell中访问它?谢谢,

aca*_*nby 5

你的链接有答案:

该插件提供了一些非常有用的环境变量.

  1. ghprbActualCommit

  2. ghprbActualCommitAuthor

  3. ghprbActualCommitAuthorEmail

  4. ghprbPullDescription

  5. ghprbPullId

  6. ghprbPullLink

  7. ghprbPullTitle

  8. ghprbSourceBranch

  9. ghprbTargetBranch

  10. SHA1

您将希望用于$ghprbSourceBranch获取在脚本中的其他位置构建分支的值.