refactor: enforce 'v' prefix for version tags in deploy workflow triggers and logic.

This commit is contained in:
2026-02-17 21:29:53 +01:00
parent a0738e6ea1
commit 5c533292dd

View File

@@ -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)