File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -13,13 +13,18 @@ getValidationResult() {
1313 --header " Accept: application/json" \
1414 --header " Authorization: Bearer ${ACCESS_TOKEN} " \
1515 --data-raw " ${BODY} " )
16- RESULT=$( echo $RESPONSE | jq -re ' .result.records[0].result' )
16+ # Ensure that all validations have passed
17+ RESULT=$( echo $RESPONSE | jq ' all(.[]; .result == "pass")' )
1718
1819 echo Found result [${RESULT} ] for job [JOB_ID::${JOB_ID} ]
19- if [[ " $RESULT " == " pass " ]]; then
20+ if [[ " $RESULT " == " true " ]]; then
2021 return 0
2122 fi
2223
24+ # On fail, list failed validations
25+ FAILED_VALIDATIONS=$( echo $RESPONSE | jq -c ' [.[] | select(.result != "pass") | .name]' )
26+ echo " Failed validations: ${FAILED_VALIDATIONS} "
27+
2328 return 1
2429}
2530
You can’t perform that action at this time.
0 commit comments