Skip to content

Commit 61cabea

Browse files
Enforce clean high-severity build dependency audit
1 parent 3304f06 commit 61cabea

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

‎.github/workflows/agent-api-security.yml‎

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ jobs:
3939

4040
steps:
4141
- name: Check out repository
42-
uses: actions/checkout@v4
42+
uses: actions/checkout@v6
4343

4444
- name: Set up Node.js
45-
uses: actions/setup-node@v4
45+
uses: actions/setup-node@v6
4646
with:
4747
node-version: '22.23.1'
48-
cache: npm
48+
package-manager-cache: false
4949

5050
- name: Install locked dependencies
5151
run: npm ci
@@ -129,3 +129,20 @@ jobs:
129129

130130
- name: Enforce runtime dependency audit
131131
run: node scripts/enforceRuntimeAudit.js npm-audit-runtime.json npm-audit-full.json
132+
133+
- name: Enforce build dependency audit
134+
run: |
135+
node <<'NODE'
136+
import fs from 'node:fs';
137+
138+
const audit = JSON.parse(fs.readFileSync('npm-audit-full.json', 'utf8'));
139+
const counts = audit.metadata?.vulnerabilities || {};
140+
const high = Number(counts.high || 0);
141+
const critical = Number(counts.critical || 0);
142+
143+
if (high > 0 || critical > 0) {
144+
throw new Error(`Build dependency audit contains ${high} high and ${critical} critical findings.`);
145+
}
146+
147+
console.log('Build dependency audit has no high or critical findings.');
148+
NODE

0 commit comments

Comments
 (0)