From 3526b996caf83b518d52a4bfd464524f936ddc0c Mon Sep 17 00:00:00 2001 From: TC Date: Mon, 8 Sep 2025 01:30:43 +0000 Subject: [PATCH] =?UTF-8?q?CI=5FCOMMIT=5FBRANCH=20isn't=20available=20in?= =?UTF-8?q?=20merge=20request=20pipelines=20=F0=9F=98=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 88322b5f..29444cf6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,14 +58,14 @@ build_cache: - apk update && apk add jq && apk add curl # Determine cache tag based on branch use branch name as tag, sanitize for Docker tag compatibility - | - if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then + if [[ "$CI_COMMIT_BRANCH" == null ]]; then CACHE_TAG="$CI_DEFAULT_BRANCH" CACHE_NAME="build-cache" else CACHE_TAG=$(echo "$CI_COMMIT_BRANCH" | sed 's/[^a-zA-Z0-9._-]/-/g') - CACHE_NAME="build-cache-branch" + CACHE_NAME="build-cache" fi - - 'echo "Using cache tag: $CACHE_TAG in repository: $CACHE_NAME"' + - 'echo "Using cache tag: $CACHE_TAG in image: $CACHE_NAME"' # Check if cache exists - if ! docker manifest inspect $CI_REGISTRY_IMAGE/$CACHE_NAME:$CACHE_TAG > /dev/null 2>&1; then - CACHE_EPOCH=0