所以我有一个jenkinsfile
,其中有我的管道。我希望能够区分发送到主服务器的拉取请求和发送到其他地方的拉取请求。我找到了用于检测拉取请求的示例代码 - 像这样:
env.BRANCH_NAME.startsWith('PR-')
但是有没有办法从某些 env.
变量中找出拉取请求的目标?
最佳答案
根据https://yourjenkinsurl/pipeline-syntax/globals
:
CHANGE_TARGET
For a multibranch project corresponding to some kind of change request, this will be set to the target or base branch to which the change could be merged, if supported; else unset.
关于Jenkinsfile - 如何检测拉取请求的目的地,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44696833/