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: JSON Lint | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| lint-json: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install jsonlint-cli | |
| run: npm install --global jsonlint-cli | |
| - name: Lint repos/*.json | |
| run: | | |
| shopt -s nullglob | |
| files=(repos/*.json) | |
| if [ ${#files[@]} -eq 0 ]; then | |
| echo "No JSON files found under repos/" | |
| exit 0 | |
| fi | |
| jsonlint -q "${files[@]}" |