Skip to content

Commit b59ed4c

Browse files
CryptoJonesAaron K. Clarkclaude
authored
chore(ci): npm audit gate on production deps + engines.node pin (#99)
Two small package-quality improvements: 1. **`npm run audit`** runs `npm audit --audit-level=high --omit=dev`, gating the build on any high-or-critical advisory affecting production dependencies. Dev tools (eslint, vitest, supertest) are excluded so a fast-moving advisory there doesn't block shipping; the production path is what we care about for deployment risk. GH Actions + Woodpecker both run the new step between lint and the test matrix. 2. **`engines.node`** in package.json pins the minimum supported Node version (>=20.0.0). Matches the CI matrix and the Docker base image. Older Node will see an npm WARN at install time rather than mysterious runtime failures. Current state: 0 vulnerabilities. The new step locks in that baseline; any future dependency drift triggers a CI failure operators can investigate before the bad version reaches prod. Tests: full suite 479 pass / 4 skip — unchanged. Co-authored-by: Aaron K. Clark <akclark@thenetwerk.net> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3003838 commit b59ed4c

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,7 @@ jobs:
7272
run: npm run migrate
7373
- name: Lint
7474
run: npm run lint
75+
- name: npm audit (production deps, high+)
76+
run: npm run audit
7577
- name: Run vitest (unit + api + integration)
7678
run: npm test

.woodpecker.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ steps:
3636
- npm ci
3737
- npm run migrate
3838
- npm run lint
39+
- npm run audit
3940
- npm test
4041

4142
test-node-22:
@@ -61,4 +62,5 @@ steps:
6162
- npm ci
6263
- npm run migrate
6364
- npm run lint
65+
- npm run audit
6466
- npm test

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@
1515
"test:watch": "vitest",
1616
"lint": "eslint app/ server.js tests/",
1717
"lint:fix": "eslint --fix app/ server.js tests/",
18+
"audit": "npm audit --audit-level=high --omit=dev",
1819
"migrate": "sequelize-cli db:migrate",
1920
"migrate:undo": "sequelize-cli db:migrate:undo",
2021
"migrate:status": "sequelize-cli db:migrate:status",
2122
"migrate:generate": "sequelize-cli migration:generate --name"
2223
},
24+
"engines": {
25+
"node": ">=20.0.0"
26+
},
2327
"author": "https://github.com/CryptoJones",
2428
"license": "Apache-2.0",
2529
"dependencies": {

0 commit comments

Comments
 (0)