File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff 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" \
You can’t perform that action at this time.
0 commit comments