-
Notifications
You must be signed in to change notification settings - Fork 13
31 lines (29 loc) · 874 Bytes
/
audit.yml
File metadata and controls
31 lines (29 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Audit
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
npm_audit:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install Monorepo Deps
run: npm ci
- name: Run npm audit
run: >
npm audit --json |
node -e '
const fs = require("fs");
const auditLevel = (process.argv[1] || "critical").toLowerCase();
const { vulnerabilities } = JSON.parse(fs.readFileSync(0).toString("utf-8"));
const result = Object.values(vulnerabilities).filter((i) => i.severity.toLowerCase() === auditLevel);
console.table(JSON.stringify(result, null, 2));
' high