Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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