I can run a job for a merge request like so:
test:
stage: test
script: ./test
only:
- merge_requests
However, I also only want to run this job if the target branch is a specific one (e.g. master
). Is it possible to do this?
I can run a job for a merge request like so:
test:
stage: test
script: ./test
only:
- merge_requests
However, I also only want to run this job if the target branch is a specific one (e.g. master
). Is it possible to do this?
Merge request where the target branch is master:
only:
refs:
- merge_requests
variables:
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
It is possible only starting from Gitlab 11.6 according to the docs https://docs.gitlab.com/ee/ci/merge_request_pipelines/