Merge pull request #310 from Johnpii1/main #284
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: Check schema sync | |
| on: | |
| push: | |
| branches: ["main", "master"] | |
| pull_request: | |
| branches: ["main", "master"] | |
| jobs: | |
| check-schema: | |
| name: Check schema is in sync | |
| runs-on: ubuntu-latest | |
| env: | |
| BOUNDLESS_NESTJS_TOKEN: ${{ secrets.BOUNDLESS_NESTJS_TOKEN }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Checkout canonical schema repo (private) | |
| if: ${{ env.BOUNDLESS_NESTJS_TOKEN != '' }} | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: boundlessfi/boundless-nestjs | |
| path: boundless-nestjs | |
| token: ${{ env.BOUNDLESS_NESTJS_TOKEN }} | |
| - name: Note about private repo | |
| if: ${{ env.BOUNDLESS_NESTJS_TOKEN == '' }} | |
| run: | | |
| echo "No secret BOUNDLESS_NESTJS_TOKEN provided; skipping checkout of private repo." | |
| echo "This is expected for forked pull requests where repository secrets are not exposed." | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Run schema check | |
| if: ${{ env.BOUNDLESS_NESTJS_TOKEN != '' }} | |
| run: node ./scripts/sync-schema.js --check | |
| - name: Skip schema check without private repo token | |
| if: ${{ env.BOUNDLESS_NESTJS_TOKEN == '' }} | |
| run: | | |
| echo "Skipping schema sync check because BOUNDLESS_NESTJS_TOKEN is not available." | |
| echo "Maintainers can run the full schema check from a trusted branch with the secret available." |