[SimWF] Allow any detectors (#1441) #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Validate JSON syntax | |
# Run on any commit or PR that changes any JSON file. | |
'on': | |
push: | |
paths: | |
- '**.json' | |
pull_request: | |
paths: | |
- '**.json' | |
permissions: {} | |
jobs: | |
json-syntax: | |
name: validate syntax | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Validate syntax for JSON files | |
run: | | |
error=0 | |
readarray -d '' json_files < \ | |
<(find . \( -path ./.git -or -path ./DATA/testing/private \) -prune -false -or -type f -name '*.json' -print0) | |
for jsonf in "${json_files[@]}"; do | |
echo "::debug::Checking $jsonf..." | |
if ! errmsg=$(jq . "$jsonf" 2>&1 >/dev/null); then | |
error=1 | |
echo "Invalid JSON syntax found in $jsonf:" >&2 | |
printf '::error file=%s,title=%s::%s\n' "$jsonf" 'Invalid JSON syntax' "$errmsg" | |
fi | |
done | |
exit "$error" |