Add PR job that checks changed token files #10
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 tokens | |
| on: | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Check changed token files | |
| env: | |
| BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| run: | | |
| # --no-renames splits a rename into delete + add, so the old path is | |
| # reported as deleted and fails the check. | |
| files=$(git diff --name-only --no-renames "$BASE_SHA"...HEAD -- 'tokensStudio/**/*.json') | |
| [ -n "$files" ] || { echo "No token files changed"; exit 0; } | |
| echo "$files" | xargs node scripts/check-changed-tokens.js |