Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docker-tag): do not fail if tag already exists #174

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

floriantz
Copy link
Contributor

Same as the previous PR but with an addition to better handle the error. I had a bit of a different behaviour when testing it locally and didn't have it crashing but piping the error to /dev/null should fix it hopefully.

@floriantz floriantz requested a review from a team as a code owner October 21, 2024 12:47
@@ -70,5 +70,10 @@ jobs:

- name: Tag image
run: |
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"
IMAGE_EXISTS=$(aws ecr describe-images --repository-name ${{ inputs.image_name }} --image-ids imageTag=${{ inputs.image_tag_to }} 2>/dev/null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only addition to the initial PR is the 2>/dev/null

@floriantz floriantz merged commit 1eee321 into master Oct 21, 2024
1 check passed
@floriantz floriantz deleted the chore/do-not-fail-if-tag-already-exists branch October 21, 2024 13:02
floriantz added a commit that referenced this pull request Oct 21, 2024
floriantz added a commit that referenced this pull request Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants