-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (71 loc) · 2.17 KB
/
audit.yml
File metadata and controls
77 lines (71 loc) · 2.17 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
71
72
73
74
75
76
77
name: audit
on:
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:
pull_request:
paths:
- 'requirements*.txt'
- 'web/package*.json'
- '.github/workflows/audit.yml'
permissions:
contents: read
jobs:
python-vuln:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- run: pip install pip-audit
- name: pip-audit (runtime + dev)
run: pip-audit -r requirements.txt -r requirements-dev.txt
python-license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- run: pip install -r requirements.txt -r requirements-dev.txt pip-licenses
- name: report licenses
run: pip-licenses --format=markdown --output-file=python-licenses.md
- name: fail on copyleft (GPL family except LGPL)
run: |
if pip-licenses --format=plain-vertical --with-license-file=false \
| grep -E '^(License: )?(GNU )?(Affero )?General Public License' \
| grep -v 'Lesser'; then
echo "::error::Copyleft license found in dependency tree."
exit 1
fi
- uses: actions/upload-artifact@v7
with:
name: python-licenses
path: python-licenses.md
retention-days: 30
npm-vuln:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
- run: npm install --prefix web
- name: npm audit (production, high+)
run: npm audit --prefix web --omit=dev --audit-level=high
npm-license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
- run: npm install --prefix web
- name: report licenses
run: npx --yes license-checker --start web --production --summary > npm-licenses.txt
- uses: actions/upload-artifact@v7
with:
name: npm-licenses
path: npm-licenses.txt
retention-days: 30