Skip to content

Commit 5bfe198

Browse files
committed
Add nightly security audit for node-modules
1 parent f3d0786 commit 5bfe198

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Nightly Security Audit
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * *'
6+
workflow_dispatch: # Allow manual trigger
7+
8+
jobs:
9+
npm-audit:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v6
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v6
20+
with:
21+
node-version: 24
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
- name: Run security audit
26+
shell: bash
27+
run: |
28+
echo '### npm audit (`--omit=dev`)' >> "$GITHUB_STEP_SUMMARY"
29+
echo "" >> "$GITHUB_STEP_SUMMARY"
30+
echo '```text' >> "$GITHUB_STEP_SUMMARY"
31+
set +e
32+
set -o pipefail
33+
npm audit --omit=dev --audit-level high 2>&1 | tee -a "$GITHUB_STEP_SUMMARY"
34+
exit_code=$?
35+
echo '```' >> "$GITHUB_STEP_SUMMARY"
36+
exit $exit_code

0 commit comments

Comments
 (0)