diff --git a/.github/workflows/awscleanup.yaml b/.github/workflows/awscleanup.yaml index 2b0c5dc6..e0797fb2 100644 --- a/.github/workflows/awscleanup.yaml +++ b/.github/workflows/awscleanup.yaml @@ -57,13 +57,13 @@ jobs: if [[ -z "$response" || "$response" == "null" ]]; then continue fi - echo "SHIVA $response" - is_job_running=$(echo "$response" | jq -r " + + is_jobs_not_completed=$(echo "$response" | jq -r " .jobs? // [] | - map(select(.status == \"in_progress\" or .status == \"queued\")) | - length - ") - if [[ "$is_job_running" -eq 0 ]]; then + map(select(.status != \"completed\")) | + length") + + if [[ "$is_jobs_not_completed" -eq 0 ]]; then echo "Holodeck e2e Job status is not in running stage , Delete the dependent resources" scripts/awscleanup.sh $vpc fi