在GitLab CI中,合并请求的目标分支是否有变量?
问题描述:
在我的管道中,仅当Merge Requests目标分支是某个分支(例如master或release)时,我才希望运行作业.
In my pipeline, I'd like to have a job run only if the Merge Requests target branch is a certain branch, say master or release.
这可能吗?
我已阅读 https://docs.gitlab.com/ee/ci/变量/,除非我错过了什么,否则我看不到有什么可以帮助您的.
I've read through https://docs.gitlab.com/ee/ci/variables/ and unless I missed something, I'm not seeing anything that can help.
答
Gitlab CI与合并请求无关(目前).由于管道在Origin分支上运行,因此您将无法检索目标.
Gitlab CI is agnostic of Merge Requests (for now). Since the pipeline runs on the origin branch you will not be able to retrieve the destination.