Expose CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED as CI Variable
What does this MR do and why?
This adds the CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED
variable, so it can be used as example in the rules of a job to control behaviour based on the protection status from the target branch
Screenshots or screen recordings
How to set up and validate locally
- Checkout branch
- Start GDK
- Create a pipeline
job:
script:
- echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
- echo $CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED
rules:
- if: $CI_MERGE_REQUEST_ID
- Create a merge request with some changes to the file against a protected branch
- Create a merge request with some changes to the file against a not protected branch
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #364774 (closed)