Skip to content

Commit 06d1fc6

Browse files
committed
feat: append SHORT_COMMIT_HASH to all images
1 parent 36d3dc4 commit 06d1fc6

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

.github/workflows/stage-3-build-images.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -287,20 +287,16 @@ jobs:
287287
echo "Processing repository: $repo_name"
288288
289289
echo " Checking for existing target tag: $SHORT_COMMIT_HASH"
290-
target_tag_check_output=$(az acr repository show-manifests --name "$ACR_NAME" --repository "$repo_name" --query "[?tags.contains(@, '${SHORT_COMMIT_HASH}')]" --output tsv 2>&1)
291-
target_tag_check_status=$? # Get exit status of the check command
292-
293-
if [ $target_tag_check_status -ne 0 ]; then
294-
echo " ⚠️ Warning: Failed to check for existing target tag '$SHORT_COMMIT_HASH' for repo '$repo_name'. Error: $target_tag_check_output"
295-
echo " Proceeding to import attempt regardless..."
296-
elif [ -n "$target_tag_check_output" ]; then
297-
# Check command succeeded (exit status 0) AND output is non-empty, meaning tag exists
298-
echo " Target tag '$SHORT_COMMIT_HASH' already exists. Skipping import for this repository."
299-
echo "---"
300-
continue
290+
target_tag_check_output=$(az acr manifest list-metadata --registry "$ACR_NAME" --name "$repo_name" --query "[?tags.contains(@, '${SHORT_COMMIT_HASH}')]" --output tsv 2>&1)
291+
target_tag_check_status=$?
292+
293+
if [ $target_tag_check_status -eq 0 ] && [ -n "$target_tag_check_output" ]; then
294+
echo " Target tag '$SHORT_COMMIT_HASH' already exists. Skipping import for this repository."
295+
echo "---"
296+
continue
301297
fi
302298
303-
echo "Target tag '$SHORT_COMMIT_HASH' not found or check failed. Attempting import: $source_image -> $target_image"
299+
echo " Proceeding with import attempt: $source_image -> $target_image"
304300
305301
az acr import \
306302
--name "$ACR_NAME" \

0 commit comments

Comments
 (0)