/ .github / workflows / language-policy.yml
language-policy.yml
 1  # SPDX-License-Identifier: AGPL-3.0-or-later
 2  # SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell
 3  name: Language Policy Enforcement
 4  
 5  on:
 6    push:
 7      branches: [main]
 8    pull_request:
 9      branches: [main]
10  
11  permissions: read-all
12  
13  jobs:
14    enforce-language-policy:
15      runs-on: ubuntu-latest
16      steps:
17        - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
18  
19        - name: Check for banned TypeScript files
20          run: |
21            if find . -name "*.ts" -type f | grep -v node_modules | grep -q .; then
22              echo "ERROR: TypeScript files found. Use ReScript instead."
23              find . -name "*.ts" -type f | grep -v node_modules
24              exit 1
25            fi
26            echo "✓ No TypeScript files found"
27  
28        - name: Check for banned Go files
29          run: |
30            if find . -name "*.go" -type f | grep -q .; then
31              echo "ERROR: Go files found. Use Rust instead."
32              find . -name "*.go" -type f
33              exit 1
34            fi
35            echo "✓ No Go files found"
36  
37        - name: Check for banned Python files (except SaltStack)
38          run: |
39            if find . -name "*.py" -type f | grep -v salt | grep -v node_modules | grep -q .; then
40              echo "ERROR: Python files found outside salt/. Python only allowed for SaltStack."
41              find . -name "*.py" -type f | grep -v salt | grep -v node_modules
42              exit 1
43            fi
44            echo "✓ No unauthorized Python files found"
45  
46        - name: Verify ReScript configuration exists
47          run: |
48            if [ ! -f rescript.json ]; then
49              echo "ERROR: rescript.json not found. ReScript is required."
50              exit 1
51            fi
52            echo "✓ rescript.json found"