zh-tw translation improvement #14
Workflow file for this run
This file contains hidden or 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 | |
| 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 |