Skip to content

Commit f8a025c

Browse files
committed
ci: add daily audit canary for the v5 stable release
Adds a scheduled workflow that installs the published aws-amplify `stable-5` dist-tag into a clean project and runs `npm audit` daily, so newly disclosed vulnerabilities in the v5 LTS dependency tree are surfaced proactively rather than via consumer reports. Generic (not tied to any single advisory). Scheduled workflows only run from the default branch, so this lives on main while auditing the stable-5 line.
1 parent 67a015a commit f8a025c

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Daily v5 stable audit canary
2+
3+
# Installs the published aws-amplify v5 LTS release (the `stable-5` dist-tag) into
4+
# a clean project and runs `npm audit`, so newly disclosed vulnerabilities in the
5+
# v5 dependency tree are caught proactively rather than via consumer reports.
6+
#
7+
# NOTE: scheduled workflows only run from the repository default branch (main),
8+
# so this lives on main even though it audits the stable-5 line.
9+
10+
on:
11+
# 15:30 UTC / 8:30am PDT daily (offset from the existing canary at 15:00 UTC)
12+
schedule:
13+
- cron: '30 15 * * *'
14+
# Allow manual runs for ad-hoc verification.
15+
workflow_dispatch:
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
audit-v5-stable:
22+
name: npm audit (aws-amplify@stable-5)
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Setup Node.js
26+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
27+
with:
28+
node-version: 18
29+
30+
- name: Install published aws-amplify@stable-5
31+
run: |
32+
mkdir -p audit-canary && cd audit-canary
33+
npm init -y > /dev/null 2>&1
34+
# --ignore-scripts: do not execute lifecycle scripts from published deps.
35+
npm install --omit=dev --ignore-scripts aws-amplify@stable-5
36+
37+
- name: Run npm audit (production dependencies)
38+
working-directory: audit-canary
39+
run: |
40+
# Human-readable report first (does not fail the step).
41+
npm audit --omit=dev || true
42+
# Gate: fail the run on any advisory in the production tree.
43+
# Tune the threshold with --audit-level=<low|moderate|high|critical> if
44+
# low-severity noise becomes a problem on the LTS line.
45+
npm audit --omit=dev

0 commit comments

Comments
 (0)