Skip to content

Commit 79b80b4

Browse files
Update unique tag generation in deploy workflow
Sanitize branch name for Docker tag generation.
1 parent 113f062 commit 79b80b4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/deploy-unified.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ jobs:
163163
# Generate unique tag for manual deployment runs
164164
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
165165
RUN_ID="${{ github.run_id }}"
166-
UNIQUE_TAG="manual-${TIMESTAMP}-${RUN_ID}"
166+
BRANCH_NAME="${{ env.BRANCH_NAME }}"
167+
# Sanitize branch name for Docker tag (replace invalid characters with hyphens)
168+
CLEAN_BRANCH_NAME=$(echo "$BRANCH_NAME" | sed 's/[^a-zA-Z0-9._-]/-/g' | sed 's/--*/-/g' | sed 's/^-\|-$//g')
169+
UNIQUE_TAG="${CLEAN_BRANCH_NAME}-${TIMESTAMP}-${RUN_ID}"
167170
echo "IMAGE_TAG=$UNIQUE_TAG" >> $GITHUB_ENV
168171
echo "IMAGE_TAG=$UNIQUE_TAG" >> $GITHUB_OUTPUT
169172
echo "Generated unique Docker tag: $UNIQUE_TAG"

0 commit comments

Comments
 (0)