Skip to content

Commit 467eec0

Browse files
iraeEricRibeiro
andauthored
fix: skip_when_tags_exist inverted (#305)
* fix: skip_when_tags_exist inverted When using `skip_when_tags_exist`, the behavior is inverted. When `true` it should check and skip. When `false`, it should just tag it. The code currently on `master` does the exact opposite. * fix: conditional * ci: add `skip_when_tags_exist` in the test job --------- Co-authored-by: Eric Ribeiro <[email protected]>
1 parent eb2e445 commit 467eec0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.circleci/test-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
region: <<parameters.region>>
4848
- aws-ecr/tag_image:
4949
repo: <<parameters.repo>>
50+
skip_when_tags_exist: <<parameters.skip_when_tags_exist>>
5051
source_tag: <<parameters.source_tag>>
5152
target_tag: <<parameters.target_tag>>
5253
build-test-then-push-with-buildx:

src/scripts/tag_image.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ IFS="," read -ra ECR_TAGS <<<"${ORB_STR_TARGET_TAG}"
1111

1212
for tag in "${ECR_TAGS[@]}"; do
1313
# if skip_when_tags_exist is true
14-
if [ "${ORB_BOOL_SKIP_WHEN_TAGS_EXIST}" -eq "0" ]; then
14+
if [ "${ORB_BOOL_SKIP_WHEN_TAGS_EXIST}" -eq 1 ]; then
1515
# tag image if tag does not exist
1616
if ! echo "${EXISTING_TAGS}" | grep "${tag}"; then
1717
aws ecr put-image --repository-name "${ORB_STR_REPO}" --image-tag "${tag}" --image-manifest "${MANIFEST}"
@@ -23,4 +23,4 @@ for tag in "${ECR_TAGS[@]}"; do
2323
aws ecr put-image --repository-name "${ORB_STR_REPO}" --image-tag "${tag}" --image-manifest "${MANIFEST}"
2424
fi
2525
done
26-
set +x
26+
set +x

0 commit comments

Comments
 (0)