From 250c27c3fbf06577b2a7a2e3819a717f11ee4b99 Mon Sep 17 00:00:00 2001 From: Mitchell Henke Date: Thu, 31 Aug 2023 12:52:07 -0500 Subject: [PATCH] Improve robustness of Elastic Container Registry container scan status check changelog: Internal, Container Scanning, Improve robustness of Elastic Container Registry container scan status check --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 29e93a64a2d..7a2b2155540 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -468,9 +468,10 @@ ecr-scan: - > while true; do SCAN_STATUS=$(aws ecr describe-image-scan-findings --repository-name identity-idp/review --image-id imageTag=$CI_COMMIT_SHA --query 'imageScanStatus.status' --output text || true) - if [ "$SCAN_STATUS" == "ACTIVE" ]; then + if echo "$SCAN_STATUS" | grep -q "ACTIVE"; then + echo "Scan Complete" break - elif [ "$SCAN_STATUS" == "FAILED" ]; then + elif echo "$SCAN_STATUS" | grep -q "FAILED"; then echo "ECR scan failed" exit 1 else