allows to show up additional resorces #50
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: JSON CI | |
| on: | |
| push: | |
| branches: | |
| - 'vcmi-*' | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| validate-json: | |
| name: Validate JSON | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| outputs: | |
| valid: ${{ steps.validate.outcome == 'success' }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install jstyleson | |
| run: sudo apt install python3-jstyleson | |
| - name: Validate JSON syntax | |
| id: validate | |
| run: python3 .github/validate_json.py | |
| format-json: | |
| name: Format JSON | |
| needs: validate-json | |
| if: ${{ needs.validate-json.result == 'success' && github.event_name != 'pull_request' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| npm install -g prettier | |
| - name: Format JSON files with Prettier | |
| run: | | |
| prettier --write "**/*.json" \ | |
| --parser jsonc \ | |
| --use-tabs \ | |
| --tab-width 4 \ | |
| --trailing-comma none \ | |
| --print-width 1 | |
| - name: Postprocess colon spacing | |
| run: python3 .github/postprocess_colons.py | |
| - name: Commit changes if needed | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| default_author: github_actions | |
| message: "Auto-format JSON files" | |
| add: '*.json' |