File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Audit
2+ on :
3+ push :
4+ branches :
5+ - master
6+ pull_request :
7+ branches :
8+ - master
9+ jobs :
10+ npm_audit :
11+ runs-on : ubuntu-latest
12+ steps :
13+ # Checks-out your repository under $GITHUB_WORKSPACE
14+ - uses : actions/checkout@v3
15+ - uses : actions/setup-node@v3
16+ with :
17+ node-version : 20.x
18+
19+ - name : Install Monorepo Deps
20+ run : npm ci
21+
22+ - name : Run npm audit
23+ run : >
24+ npm audit --json |
25+ node -e '
26+ const fs = require("fs");
27+ const auditLevel = (process.argv[1] || "critical").toLowerCase();
28+ const { vulnerabilities } = JSON.parse(fs.readFileSync(0).toString("utf-8"));
29+ const result = Object.values(vulnerabilities).filter((i) => i.severity.toLowerCase() === auditLevel);
30+ console.table(JSON.stringify(result, null, 2));
31+ ' high
You can’t perform that action at this time.
0 commit comments