Skip to content

Commit

Permalink
fix array index error
Browse files Browse the repository at this point in the history
  • Loading branch information
ibnaleem authored Jan 17, 2025
1 parent 0a0c977 commit db886b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/validate-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "main"
pull_request:
branches:
- "main"
- "main"

jobs:
validate-json:
Expand All @@ -20,7 +20,8 @@ jobs:
run: |
# Validate the JSON file in the root directory
echo "Validating data.json"
jq -e 'map(
jq -e '.websites | map(
.name | type == "string" and
.base_url | type == "string" and
(.url_probe | type == "string" or .url_probe == null) and
Expand All @@ -31,6 +32,7 @@ jobs:
(.errorType != "errorMsg" and .errorCode | type == "integer" and .errorMsg == null)
)
)' data.json
if [[ $? -ne 0 ]]; then
echo "Validation failed for data.json"
exit 1
Expand Down

0 comments on commit db886b8

Please sign in to comment.