Skip to content

GitLab CI: No merge request environment variables are set

Hey there,

just encountered the bug, that GitLab-CI does not set the merge request environment variables.

I tested it out on https://gitlab.com/YannickFricke/test.

Tried to perform a merge request from develop to master and from a fork of this project to the original project.

Both times the merge request variables are not set.

Just print out the value of these variables:

CI_MERGE_REQUEST_ID 
CI_MERGE_REQUEST_IID 
CI_MERGE_REQUEST_REF_PATH 
CI_MERGE_REQUEST_PROJECT_ID 
CI_MERGE_REQUEST_PROJECT_PATH 
CI_MERGE_REQUEST_PROJECT_URL 
CI_MERGE_REQUEST_TARGET_BRANCH_NAME 
CI_MERGE_REQUEST_SOURCE_PROJECT_ID 
CI_MERGE_REQUEST_SOURCE_PROJECT_PATH 
CI_MERGE_REQUEST_SOURCE_PROJECT_URL 
CI_MERGE_REQUEST_SOURCE_BRANCH_NAME 

Yours sincerely Yannick Fricke

PS: When it should be the wrong repo please apologize :)

Refer then to the correct one please :)

Edited by Yannick Fricke