From 7cb14e192fcec03e1ad27c0f11687a59744f133e Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Tue, 27 Jan 2026 11:02:07 +0100 Subject: [PATCH] ci: workaround CI_COMMIT_BRANCH to CI_COMMIT_REF_NAME for tag pipelines --- .gitlab/ci/common.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/ci/common.yml b/.gitlab/ci/common.yml index 71a8801de4..1b648cbfe3 100644 --- a/.gitlab/ci/common.yml +++ b/.gitlab/ci/common.yml @@ -382,7 +382,7 @@ variables: - MIRROR_REPO_URL="${LOCAL_GIT_MIRROR}/${CI_PROJECT_PATH}" - cd "${CI_PROJECT_DIR}" # since .cache exists in CI_PROJECT_DIR, so can't direct `git clone .` - - git clone -b ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_COMMIT_BRANCH}} --depth=1 --recursive --shallow-submodules "${MIRROR_REPO_URL}" tmp + - git clone -b ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_COMMIT_REF_NAME}} --depth=1 --recursive --shallow-submodules "${MIRROR_REPO_URL}" tmp - mv tmp/.git ./ - rm -rf tmp - git reset --hard