fix(ci): estate-wide foundational remediation (#23) #41
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-License-Identifier: MPL-2.0 | |
| name: TypeScript/JavaScript Blocker | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| # Estate guardrail: scope push to default branches so a PR fires once (not | |
| # push+PR), and cancel superseded runs. Safe — read-only PR-triggered check. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Block new TypeScript/JavaScript | |
| run: | | |
| NEW_TS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(ts|tsx)$' | grep -v '\.gen\.' || true) | |
| NEW_JS=$(git diff --name-only --diff-filter=A HEAD~1 2>/dev/null | grep -E '\.(js|jsx)$' | grep -v '\.res\.js$' | grep -v '\.gen\.' | grep -v 'node_modules' || true) | |
| if [ -n "$NEW_TS" ] || [ -n "$NEW_JS" ]; then | |
| echo "❌ New TS/JS files detected. Use ReScript instead." | |
| [ -n "$NEW_TS" ] && echo "$NEW_TS" | |
| [ -n "$NEW_JS" ] && echo "$NEW_JS" | |
| exit 1 | |
| fi | |
| echo "✅ ReScript policy enforced" |