CircleCI-Public / aws-ecr-orb

CircleCI orb for interacting with Amazon's Elastic Container Registry (ECR)
https://circleci.com/orbs/registry/orb/circleci/aws-ecr
MIT License
81 stars 142 forks source link

tag-image: skip tagging when the target is already tagged #261

Closed peter-evans closed 1 year ago

peter-evans commented 1 year ago

What would you like to be added

When a workflow with a aws-ecr/tag-image step is re-run it raises ImageAlreadyExistsException.

An error occurred (ImageAlreadyExistsException) when calling the PutImage operation: Image with digest 'sha256:<redacted>' and tag 'dev-test' already exists in the repository with name '<redacted>' in registry with id '************'

It would be great if we could skip tagging when the tag already exists on the target, similar to skip-when-tags-exist on build-image. If that's not possible, provide an option to ignore the ImageAlreadyExistsException.

Why is this needed

Sometimes we re-run workflows that have failed some part of the build. This could be because a service that the build depends on was down and caused it to fail. Or we just want to check if a build failure was transitive.

As far as I know, there is no good way to ignore errors for a specific job/step in CircleCI. So this feature would be great to avoid errors on re-runs.

peter-evans commented 1 year ago

Thank you!