Skip to content

Commit d012d19

Browse files
committed
Address CodeRabbit review: harden CI token handling, fail loud on no tests
- Set persist-credentials: false and scope the workflow token to contents: read, since this job runs pull_request-triggered installs and tests from potentially untrusted forks (flagged by zizmor; matches the permissions: block already used in black.yml). - Drop --passWithNoTests so a broken test-discovery config fails CI loudly instead of silently reporting success with zero tests run — exactly the failure mode this PR exists to prevent. Left actions/setup-node@v3 as-is: CodeRabbit flagged it as unsupported, but this repo's own Linting-Precommit workflow uses the same action version and succeeded as recently as 2026-08-03, so the claim doesn't hold for this repo's actual runners.
1 parent b6c4a14 commit d012d19

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/web-server-tests.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,18 @@ on:
1010
paths:
1111
- 'web-server/**'
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
test:
1518
runs-on: ubuntu-latest
1619

1720
steps:
1821
- name: Checkout code
1922
uses: actions/checkout@v4
23+
with:
24+
persist-credentials: false
2025

2126
- name: Setup Node.js 22
2227
uses: actions/setup-node@v3
@@ -28,5 +33,5 @@ jobs:
2833
working-directory: web-server
2934

3035
- name: Run tests
31-
run: npx jest --watchAll=false --passWithNoTests
36+
run: npx jest --watchAll=false
3237
working-directory: web-server

0 commit comments

Comments
 (0)