File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
.github/actions/get-ecr-scan-result Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 5353 - name : Get AWS ECR Scan results
5454 id : get-scan-results
5555 run : |
56- aws ecr wait image-scan-complete --debug --repository-name $ECR_REPOSITORY --image-id imageTag=$IMAGE_TAG
57- if [ $(echo $?) -eq 0 ]; then
56+ max_retries=5
57+ retries=0
58+ scan_complete=1
59+ until [ $retries -eq $max_retries ]; do
60+ aws ecr wait image-scan-complete --repository-name $ECR_REPOSITORY --image-id imageTag=$IMAGE_TAG && scan_complete=0 && break
61+ sleep 5
62+ retries=$((retries + 1))
63+ echo "Retry $retries/$max_retries: Waiting for image scan to complete..."
64+ done
65+
66+ if [ $scan_complete -eq 0 ]; then
5867 scan_findings=$(aws ecr describe-image-scan-findings --repository-name $ECR_REPOSITORY --image-id imageTag=$IMAGE_TAG | jq '.imageScanFindings.findingSeverityCounts')
5968 critical=$(echo $scan_findings | jq '.CRITICAL')
6069 high=$(echo $scan_findings | jq '.HIGH')
You can’t perform that action at this time.
0 commit comments