-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 1.71 KB
/
Copy pathsecurity.yml
File metadata and controls
70 lines (60 loc) · 1.71 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Security
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Weekly, Monday 04:27 UTC, to catch newly disclosed advisories.
- cron: "27 4 * * 1"
permissions:
contents: read
jobs:
audit:
name: Dependency audit
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 20
# Fails the build on high or critical advisories only; moderate and below
# are reported by Dependabot to avoid blocking on unfixable transitives.
- name: npm audit
run: npm audit --audit-level=high
secrets:
name: Secret scan
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # full history so the scan covers every commit
- name: Gitleaks
uses: gitleaks/gitleaks-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: TruffleHog
uses: trufflesecurity/trufflehog@v3.95.9
with:
path: ./
base: ${{ github.event_name == 'pull_request' && github.event.repository.default_branch || '' }}
head: HEAD
extra_args: --only-verified
dependency-review:
name: Dependency review
runs-on: ubuntu-latest
timeout-minutes: 10
if: github.event_name == 'pull_request'
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v7
- name: Review dependency changes
uses: actions/dependency-review-action@v5
with:
fail-on-severity: high
comment-summary-in-pr: on-failure