在 GitLab CI 中,合并请求的目标分支是否有变量? [英] In GitLab CI, is there a variable for a Merge Request's target branch?

查看:22
本文介绍了在 GitLab CI 中,合并请求的目标分支是否有变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的管道中,我希望仅当合并请求目标分支是某个分支(例如 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 与合并请求无关(目前).由于管道在源分支上运行,您将无法检索目标.

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.

这篇关于在 GitLab CI 中,合并请求的目标分支是否有变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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