File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434
3535 - name : Run unit tests
3636 run : npm run test:unit -- --passWithNoTests
37+
38+ lint :
39+ name : Lint changed files
40+ runs-on : ubuntu-latest
41+
42+ defaults :
43+ run :
44+ working-directory : frontend
45+
46+ steps :
47+ - uses : actions/checkout@v5
48+ with :
49+ fetch-depth : 0 # needed to diff against the PR base
50+
51+ - name : Setup Node.js
52+ uses : actions/setup-node@v4
53+ with :
54+ node-version-file : frontend/.nvmrc
55+ cache : npm
56+ cache-dependency-path : frontend/package-lock.json
57+
58+ - name : Install dependencies
59+ run : npm ci
60+
61+ # Diff-scoped: the frontend has a large pre-existing eslint/tsc backlog,
62+ # so a whole-repo gate isn't viable yet.
63+ - name : Lint changed files
64+ env :
65+ BASE_SHA : ${{ github.event.pull_request.base.sha }}
66+ run : |
67+ CHANGED=$(git diff --name-only --diff-filter=ACMR --relative \
68+ "$BASE_SHA" HEAD -- '*.ts' '*.tsx' '*.js')
69+ if [ -z "$CHANGED" ]; then
70+ echo "No frontend JS/TS files changed — skipping."
71+ exit 0
72+ fi
73+ echo "Linting changed files:"
74+ echo "$CHANGED"
75+ echo "$CHANGED" | xargs npx eslint
You can’t perform that action at this time.
0 commit comments