Skip to content

Commit 02a236b

Browse files
committed
Bug fix
1 parent 2a60d75 commit 02a236b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/aquasec_repo_scan.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,19 @@ jobs:
8181
exit 1
8282
fi
8383
84+
# Check if response is valid JSON
85+
if ! echo "$PAGE_RESPONSE" | jq empty 2>/dev/null; then
86+
echo "Invalid JSON response from API:"
87+
echo "$PAGE_RESPONSE"
88+
exit 1
89+
fi
90+
8491
if [ $PAGE_NUM -eq 1 ]; then
8592
TOTAL_EXPECTED=$(echo "$PAGE_RESPONSE" | jq -r '.total // 0')
93+
if ! [[ "$TOTAL_EXPECTED" =~ ^[0-9]+$ ]]; then
94+
echo "Error: Invalid total value from API: $TOTAL_EXPECTED"
95+
exit 1
96+
fi
8697
echo "Total findings expected: $TOTAL_EXPECTED"
8798
fi
8899

0 commit comments

Comments
 (0)