Skip to content

Commit 2be675f

Browse files
alchemydcclaude
andcommitted
ci: run the dependency audit as its own job
`npm audit` consults live advisory data, so it can begin failing without any change to this repository. As a step inside the `test` job it short-circuited every later step, including the bundle drift check. That is not hypothetical: when undici was bumped in #12, the audit step was already failing on unrelated advisories, so `Check bundled action` never ran and a stale `dist` bundle went undetected on main for roughly twelve hours. undici is a production dependency inlined into dist/index.js, so the bundle had genuinely drifted from the lockfile. Splitting audit into its own job keeps both signals independent: a newly published advisory no longer suppresses the build, lint, test, or drift checks, and each failure is attributable on its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent df2d4ce commit 2be675f

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ jobs:
4444
with:
4545
fail-on-severity: moderate
4646

47-
test:
48-
name: Test
47+
# Audit runs as its own job rather than as a step in `test`. npm audit
48+
# consults live advisory data, so it can start failing without any change to
49+
# this repository. As a step it short-circuited every later step, which once
50+
# hid a stale `dist` bundle for hours. Keep it independent so the bundle check
51+
# below always reports.
52+
audit:
53+
name: Audit
4954
runs-on: ubuntu-latest
5055
steps:
5156
- name: Checkout
@@ -65,6 +70,24 @@ jobs:
6570
- name: Audit dependencies
6671
run: npm audit --audit-level=moderate
6772

73+
test:
74+
name: Test
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
79+
with:
80+
persist-credentials: false
81+
82+
- name: Set up Node.js
83+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
84+
with:
85+
node-version: 24
86+
cache: npm
87+
88+
- name: Install dependencies
89+
run: npm ci
90+
6891
- name: Check formatting
6992
run: npm run format:check
7093

0 commit comments

Comments
 (0)