Repository navigation
53 lines (50 loc) · 1.62 KB
/
Copy pathsecurity.yml
File metadata and controls
53 lines (50 loc) · 1.62 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: security
on:
pull_request:
branches: [master, main]
push:
branches: [master, main]
schedule:
- cron: '11 6 * * 1'
jobs:
npm-audit:
name: dependency audit
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Audit dependencies
run: |
if [ -f package.json ]; then
# Full production report for visibility (never fails the build).
pnpm audit --prod || true
echo "::group::Gate"
# Gate on CRITICAL only. Auditing the live advisory DB at "high"
# flaps daily on transitive build/test-tooling CVEs that don't reach
# users; real shipping high+ vulns are patched via pnpm.overrides.
# Criticals are rare and genuinely block-worthy.
pnpm audit --prod --audit-level critical
echo "::endgroup::"
else
echo "no package.json — skipping audit"
fi
gitleaks:
name: gitleaks
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install gitleaks
run: |
VERSION=8.21.2
curl -sSL "https://github.com/gitleaks/gitleaks/releases/download/v${VERSION}/gitleaks_${VERSION}_linux_x64.tar.gz" \
| tar -xz -C /usr/local/bin gitleaks
gitleaks version
- name: Scan history
run: gitleaks detect --source . --redact --verbose --no-banner --exit-code 1