add validate json gha #2
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: JSON Validation | |
on: | |
pull_request: | |
paths: | |
- '**.json' | |
jobs: | |
validate-json: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Validate JSON | |
run: | | |
for file in $(find . -name "*.json"); do | |
if ! jq empty "$file" 2>/dev/null; then | |
echo "❌ Invalid JSON in $file" | |
exit 1 | |
fi | |
done | |
echo "✅ All JSON files are valid" |