From 33ec746a54ff4cb5cc867c05e66043675922deb4 Mon Sep 17 00:00:00 2001 From: naiba Date: Thu, 24 Oct 2024 22:44:13 +0800 Subject: [PATCH] fix: tag name --- .github/workflows/release.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fdb0712..0d61032 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -150,9 +150,10 @@ jobs: - name: Extract branch name in tag run: | - export TAG_NAME=$(echo ${GITHUB_REF#refs/tags/}) - if [ -z "$TAG_NAME" ]; then - export TAG_NAME=$(echo ${GITHUB_HEAD_REF}) + if [[ $GITHUB_REF == refs/heads/* ]]; then + export TAG_NAME=$(echo ${GITHUB_REF#refs/heads/}) + else + export TAG_NAME=$(echo ${GITHUB_REF#refs/tags/}) fi echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT id: extract_branch