Search code examples
gitlabgitlab-ci

In GitLab CI, is there a variable for a Merge Request's target branch?


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.

Is this possible?

I've read through https://docs.gitlab.com/ee/ci/variables/ and unless I missed something, I'm not seeing anything that can help.


Solution

  • 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.