Fallback to using 'CI_COMMIT_SHA' when pipeline is 'detached'
What does this MR do?
This is a follow-up of !26130 (merged).
When a pipeline runs in detached
mode (e.g. when the MR is a WIP), CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
(and CI_MERGE_REQUEST_TARGET_BRANCH_SHA
) is empty, as can be seen in https://gitlab.com/gitlab-org/gitlab/-/jobs/455921920 (compared to https://gitlab.com/gitlab-org/gitlab/-/jobs/455909447 which ran in merged_result
mode).
This MR makes the downstream pipelines for CNG and omnibus-gitlab
fallback to pass CI_COMMIT_SHA
instead of CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
if it's empty.
Does this MR meet the acceptance criteria?
Conformity
Edited by Kyle Wiebers