-
Notifications
You must be signed in to change notification settings - Fork 16
29 lines (25 loc) · 1.13 KB
/
npm_audit_test.yml
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
name: npm audit test
on: pull_request
jobs:
npm-audit-test:
name: npm audit test
runs-on: ubuntu-20.04
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
# Fetches all history for all branches and tags
# Needed because the audit script checks out the base branch
fetch-depth: 0
- name: Install npm
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Run npm audit
# Run npm audit on current branch and compare it with the results of running npm audit on the base branch that is set in the built-in $GITHUB_BASE_REF environment variable.
# If there are more high or critical findings in the current branch, then the test fails. If the same number of findings are found, then check that the vulnerabilities are the same.
# If they are are different, then the test fails.
run: npm run compare-audits -- $GITHUB_BASE_REF
- name: Run signature check
# Compares the signatures generated by npm locally to those provided by the registry.
run: npm audit signatures