Skip to content

Commit ea93710

Browse files
committed
Add workflow file to run npm audit
1 parent 209c0f4 commit ea93710

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Dependency Check
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: "0 6 * * MON" # every Monday at 6:00 AM UTC
8+
9+
jobs:
10+
check-dependencies:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: "20"
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Audit dependencies
26+
run: npm audit --audit-level=high
27+
continue-on-error: true
28+
29+
- name: Check audit results
30+
id: audit
31+
run: |
32+
if [ "$(npm audit --audit-level=high)" ]; then
33+
echo "Audit failed" > audit_failed.txt
34+
exit 1
35+
fi

0 commit comments

Comments
 (0)