From 367c586c45fde994b7bb757c686b7a2aad58ca2d Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Thu, 18 Jun 2026 13:45:06 +0200 Subject: [PATCH] fix(ci): use GITHUB_REF_NAME instead of template string to fix gitea empty string bug --- .gitea/workflows/deploy.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 2000b7c7c..5bbf91fcd 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -84,9 +84,10 @@ jobs: id: determine shell: bash run: | - RAW_REF="${{ github.ref }}" - REF="${RAW_REF#refs/heads/}" - REF="${REF#refs/tags/}" + REF="$GITHUB_REF_NAME" + if [ -z "$REF" ]; then + REF=$(git rev-parse --abbrev-ref HEAD | sed 's/HEAD//') + fi SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7) DOMAIN="e-tib.com" PRJ="etib" @@ -96,7 +97,7 @@ jobs: IMAGE_TAG="main-${SHORT_SHA}" ENV_FILE=".env.staging" TRAEFIK_HOST="staging.${DOMAIN}" - elif [[ "${{ github.ref }}" == refs/tags/* ]]; then + elif [[ "$GITHUB_REF" == refs/tags/* ]]; then if [[ "$REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then TARGET="production" IMAGE_TAG="$REF"