From 18f79b13b558c895c0e1daa435b4fc02b02f486c Mon Sep 17 00:00:00 2001 From: Florian Thelliez <44224782+floriantz@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:43:52 +0200 Subject: [PATCH] fix(script): handle error properly --- .github/workflows/docker-tag-v1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-tag-v1.yml b/.github/workflows/docker-tag-v1.yml index eb220f3..0867a82 100644 --- a/.github/workflows/docker-tag-v1.yml +++ b/.github/workflows/docker-tag-v1.yml @@ -70,7 +70,7 @@ jobs: - name: Tag image run: | - IMAGE_EXISTS=$(aws ecr describe-images --repository-name ${{ inputs.image_name }} --image-ids imageTag=${{ inputs.image_tag_to}}) + 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"