Skip to content

Commit 59c3a64

Browse files
Add npm audit job to CI pipeline
- Add security audit job after install step - Configure audit to fail on medium (moderate) or higher severity vulnerabilities - Audit job reuses node_modules cache from install job - Audit job always runs regardless of cache hit status Fixes CI-126. Co-authored-by: maor-rozenfeld <49363375+maor-rozenfeld@users.noreply.github.com>
1 parent 157b283 commit 59c3a64

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ jobs:
2525
- name: Install dependencies
2626
if: steps.node-modules-cache.outputs.cache-hit != 'true'
2727
run: npm ci --no-audit --no-fund
28+
audit:
29+
name: Security Audit
30+
needs: install
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v5.0.1
34+
- name: Restore node_modules cache
35+
id: node-modules-cache
36+
uses: actions/cache/restore@v4.3.0
37+
with:
38+
path: node_modules
39+
key: node-modules-cache-${{ hashFiles('package-lock.json', '.npmrc') }}
40+
fail-on-cache-miss: true
41+
- name: Run npm audit
42+
run: npm audit --audit-level=medium
2843
lint:
2944
name: Lint
3045
needs: install

0 commit comments

Comments
 (0)