chore: sync checksums and ignore backup files #73
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 Schemas | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| # Cancel older runs of the same branch/PR | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate: | |
| name: validate | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_COLOR: "1" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Ensure runner uses LF and does not rewrite files | |
| - name: Normalize git on runner | |
| run: | | |
| git config --global core.autocrlf false | |
| git config --global core.eol lf | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Validate schemas | |
| run: npm run validate:schemas | |
| - name: Validate examples | |
| run: npm run validate:examples | |
| - name: Generate checksums | |
| run: node scripts/generate-checksums.mjs schemas/v1.0.0 checksums.txt | |
| # Helpful debug if drift occurs | |
| - name: Debug checksum drift | |
| if: always() | |
| run: | | |
| echo "::group::git status" | |
| git status --porcelain || true | |
| echo "::endgroup::" | |
| echo "::group::diff checksums.txt" | |
| git diff -- checksums.txt || true | |
| echo "::endgroup::" | |
| - name: Verify checksums are current | |
| run: git diff --exit-code checksums.txt | |
| - name: Upload checksums artifact (for debugging) | |
| if: failure() || cancelled() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: checksums.txt | |
| path: checksums.txt |