From 6568908fc1266070e0c1d6f88e332c686f9ce24e Mon Sep 17 00:00:00 2001 From: Jiawei Huang Date: Mon, 6 Jan 2025 14:28:27 -0800 Subject: [PATCH] Fix tag CI build IMAGETAG undefined failure --- .semaphore/semaphore.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 8d62b5a..9e6ee04 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -23,7 +23,12 @@ global_job_config: # Semaphore is doing shallow clone on a commit without tags. # unshallow it for GIT_VERSION:=$(shell git describe --tags --dirty --always) @ Makefile.common - git fetch --unshallow - - export VERSION_TAG=${SEMAPHORE_GIT_WORKING_BRANCH} + - | + if [ "${SEMAPHORE_GIT_REF_TYPE}" = "tag" ]; then + export VERSION_TAG=${SEMAPHORE_GIT_TAG_NAME} + else + export VERSION_TAG=${SEMAPHORE_GIT_WORKING_BRANCH} + fi promotions: # Publish images for master or release tags (example: 1.23.3-llvm18.1.8-k8s1.30.5).