Skip to content

Commit 0c81d5e

Browse files
committed
fix(ci): fail the promote wait on a digest lookup error instead of retrying it
1 parent e05cf89 commit 0c81d5e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎.github/scripts/promote-app-image.sh‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ DIGEST="sha256:$(printf '%s' "$MANIFEST" | sha256sum | cut -d' ' -f1)"
1818
EPOCH=$(date +%s)
1919
bash "$SCRIPT_DIR/promote-image.sh" "$REGISTRY" "$REPOSITORY" "$SOURCE_TAG" "$DEPLOY_TAG" "$RELEASE_TAG"
2020
deadline=$(( $(date +%s) + 60 ))
21-
until [ "$(bash "$SCRIPT_DIR/get-ecr-image-digest.sh" "$REPOSITORY" "$DEPLOY_TAG" --allow-missing)" = "$DIGEST" ]; do
21+
while true; do
22+
# Assigned, not tested in the loop condition, so a failed lookup stops the script under set -e.
23+
CURRENT=$(bash "$SCRIPT_DIR/get-ecr-image-digest.sh" "$REPOSITORY" "$DEPLOY_TAG" --allow-missing)
24+
[ "$CURRENT" = "$DIGEST" ] && break
2225
if [ "$(date +%s)" -ge "$deadline" ]; then
2326
echo "ERROR: $DEPLOY_TAG did not resolve to the pushed $DIGEST within 60s; cutover cannot be correlated" >&2
2427
exit 1

0 commit comments

Comments
 (0)