Skip to content

Commit 8a00364

Browse files
authored
Handle invalid responses from the TAB API (#7961)
1 parent ae1ca0c commit 8a00364

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/ci-cd-scripts/upload-results.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ curl --silent --request POST \
3333
--form "RUNNER_ARCH=${RUNNER_ARCH:-}" \
3434
${TAB_API_URL}/api/results/bulk > test-results/tab.json
3535
cat test-results/tab.json
36-
3736
echo
37+
38+
if ! grep --quiet "block" test-results/tab.json; then
39+
echo "ERROR: Invalid response from ${TAB_API_URL}"
40+
grep --quiet 'failures="0"' test-results/junit.xml
41+
exit 0
42+
fi
43+
3844
echo "Sharing updated report:"
3945
curl --silent --request POST \
4046
--header "Content-Type: application/json" \
@@ -47,8 +53,4 @@ curl --silent --request POST \
4753
${TAB_API_URL}/api/share
4854
echo
4955

50-
if [ -f "test-results/tab.json" ]; then
51-
grep --quiet '"block": false' test-results/tab.json
52-
else
53-
grep --quiet 'failures="0"' test-results/junit.xml
54-
fi
56+
grep --quiet '"block": false' test-results/tab.json

0 commit comments

Comments
 (0)