From d9bddae20eb9ee440a2e06a8bc17067a6462cc21 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Tue, 17 Feb 2026 21:29:53 +0100 Subject: [PATCH] refactor: enforce 'v' prefix for version tags in deploy workflow triggers and logic. --- .gitea/workflows/deploy.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 5868e031..ceefde90 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -6,7 +6,6 @@ on: - '**' tags: - 'v*' - - '[0-9]+.[0-9]+.[0-9]+*' workflow_dispatch: inputs: skip_checks: @@ -65,7 +64,7 @@ jobs: ENV_FILE=".env.testing" TRAEFIK_HOST="testing.${DOMAIN}" elif [[ "${{ github.ref_type }}" == "tag" ]]; then - if [[ "$REF" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ "$REF" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then TARGET="production" IMAGE_TAG="$REF" ENV_FILE=".env.prod" @@ -114,12 +113,7 @@ jobs: echo "🔎 Checking for @mintel dependencies in package.json..." # Extract any @mintel/ version (they should be synced in monorepo) UPSTREAM_VERSION=$(grep -o '"@mintel/.*": "[^"]*"' package.json | grep -v "next-utils" | cut -d'"' -f4 | sed 's/\^//; s/\~//' | sort -V | tail -1) - # Ensure version starts with 'v' for ls-remote check if it doesn't already - if [[ "$UPSTREAM_VERSION" =~ ^[0-9] ]]; then - TAG_TO_WAIT="v$UPSTREAM_VERSION" - else - TAG_TO_WAIT="$UPSTREAM_VERSION" - fi + TAG_TO_WAIT="v$UPSTREAM_VERSION" if [[ -n "$UPSTREAM_VERSION" && "$UPSTREAM_VERSION" != "workspace:"* ]]; then # 1. Discovery (Works without token for public repositories)