Jenkins GitHub拉取请求生成器-获取执行Shell的分支名称 [英] Jenkins GitHub pull request builder - get branch name for execute shell

查看:227
本文介绍了Jenkins GitHub拉取请求生成器-获取执行Shell的分支名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Jenkins GitHub拉取请求生成器插件,用于通过Web挂钩发出拉取请求时运行我的单元测试。对于构建步骤,我需要知道要合并到其中的分支的名称(例如,如果将其合并到主分支中,则需要开发分支)。有没有一种方法可以在Jenkins 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.


  1. ghprbActualCommit

  1. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆