From 2098f5292b4c9c1e226cadd663198388991a4eed Mon Sep 17 00:00:00 2001 From: Florian Thelliez <44224782+floriantz@users.noreply.github.com> Date: Mon, 21 Oct 2024 16:22:03 +0200 Subject: [PATCH] Revert "chore(docker-tag): do not fail if tag already exists (#174)" This reverts commit 1eee321d4ce5314e147a87b83f12e6cdd6ccc073. --- .github/workflows/docker-tag-v1.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-tag-v1.yml b/.github/workflows/docker-tag-v1.yml index 0867a82..331a747 100644 --- a/.github/workflows/docker-tag-v1.yml +++ b/.github/workflows/docker-tag-v1.yml @@ -70,10 +70,5 @@ jobs: - name: Tag image run: | - IMAGE_EXISTS=$(aws ecr describe-images --repository-name ${{ inputs.image_name }} --image-ids imageTag=${{ inputs.image_tag_to }} 2>/dev/null) - if [[ -z "$IMAGE_EXISTS" ]]; then - MANIFEST=$(aws ecr batch-get-image --repository-name ${{ inputs.image_name }} --image-ids imageTag=${{ inputs.image_tag_from }} --output text --query 'images[].imageManifest') - aws ecr put-image --repository-name ${{ inputs.image_name }} --image-tag ${{ inputs.image_tag_to }} --image-manifest "$MANIFEST" - else - echo "image ${{ inputs.image_name }} tag ${{ inputs.image_tag_to }} already exists. Skipping..." - fi + MANIFEST=$(aws ecr batch-get-image --repository-name ${{ inputs.image_name }} --image-ids imageTag=${{ inputs.image_tag_from }} --output text --query 'images[].imageManifest') + aws ecr put-image --repository-name ${{ inputs.image_name }} --image-tag ${{ inputs.image_tag_to}} --image-manifest "$MANIFEST"