From 4b62192b6714c0c7e261cbb807046d1787125ab8 Mon Sep 17 00:00:00 2001 From: Daniel Colina Date: Fri, 12 Dec 2025 16:39:41 +0100 Subject: [PATCH] fix: correct image format regex to support underscores in tags The previous regex pattern [a-zA-Z0-9._-] had the hyphen in a position that caused it to be interpreted as a range operator, preventing tags with underscores (like 25.12.08-1_872913a) from matching. Changed character class order to [a-zA-Z0-9_.-] to fix the issue. This enables proper validation of immutable tags with commit hashes. --- .github/workflows/deployment-guard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment-guard.yml b/.github/workflows/deployment-guard.yml index 28ca4bc..2872d1e 100644 --- a/.github/workflows/deployment-guard.yml +++ b/.github/workflows/deployment-guard.yml @@ -399,7 +399,7 @@ jobs: echo "==================================================" # 1. Validate format (repo/name:tag) - if ! [[ "$image" =~ ^[a-zA-Z0-9_/-]+:[a-zA-Z0-9._-]+$ ]]; then + if ! [[ "$image" =~ ^[a-zA-Z0-9/_.-]+:[a-zA-Z0-9_.-]+$ ]]; then echo "❌ Image format validation failed" echo " Image: $image" echo " REASON: Invalid image format (expected format: repository/name:tag)"