Merge pull request #67 from kartoza/fix/ci-uses-flake #24
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
| # SPDX-FileCopyrightText: Tim Sutton | |
| # SPDX-License-Identifier: MIT | |
| name: 🔒 Schema Immutability | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main, master] | |
| tags: ['v*'] | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout (full history) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Nix | |
| uses: DeterminateSystems/nix-installer-action@v22 | |
| - name: Determine comparison base | |
| id: base | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| echo "ref=${{ github.event.pull_request.base.sha }}" >> "$GITHUB_OUTPUT" | |
| else | |
| # For pushes to main and tag pushes, compare against the previous commit. | |
| echo "ref=HEAD^" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Run schema-immutability checker | |
| run: | | |
| nix develop .#minimal --command \ | |
| bash scripts/check_schema_immutability.sh --base "${{ steps.base.outputs.ref }}" |