Skip to content

zh-tw translation improvement #14

zh-tw translation improvement

zh-tw translation improvement #14

name: Validate JSON
on:
pull_request:
paths:
- "**/*.json"
jobs:
validate-json:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate JSON files
run: |
echo "Checking JSON formatting..."
invalid=0
for file in $(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '.json$'); do
echo "Validating $file"
if ! jq empty "$file" 2>/dev/null; then
echo "::error file=$file::Invalid JSON format"
invalid=1
fi
done
if [ $invalid -ne 0 ]; then
echo "JSON validation failed"
exit 1
fi