Skip to content

Commit bad4a17

Browse files
committed
fix validation script to look for all validation results
1 parent a3b71ad commit bad4a17

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/actions/scripts/get-validation-result.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)