Skip to content

Predefined variable to indicate MR is in draft

Proposal

I propose adding a new predefined variable for merge request pipelines that indicates the draft status of the MR. There are already a set of predfined variables specific for merge requests (as define here: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#predefined-variables-for-merge-request-pipelines). I suggest one be added, CI_MERGE_REQUEST_STATUS that could either have the value of DRAFT or READY (I think these are the only two statuses for MRs... but could be other values if there are other statuses).

This would allow for programmatic control of jobs to differntiate between ready MRs and draft MRs (e.g. fail a merge pipeline before it does all its usual steps if it is in a draft state).