-
-
Notifications
You must be signed in to change notification settings - Fork 21
39 lines (35 loc) · 1.23 KB
/
find-vulnerabilities.yml
File metadata and controls
39 lines (35 loc) · 1.23 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
name: Find dependencies vulnerabilities
on: [push]
jobs:
scan-codebase:
runs-on: ubuntu-24.04
name: Inspect packages with ScanCode.io
steps:
- uses: actions/checkout@v4
with:
path: scancode-inputs
sparse-checkout: setup.cfg
sparse-checkout-cone-mode: false
- uses: nexB/scancode-action@alpha
with:
pipelines: "inspect_packages:StaticResolver,find_vulnerabilities"
env:
VULNERABLECODE_URL: https://public.vulnerablecode.io/
- name: Fail in case of vulnerabilities
shell: bash
run: |
scanpipe shell --command '
from scanpipe.models import Project
project = Project.objects.get()
packages_qs = project.discoveredpackages.vulnerable()
dependencies_qs = project.discovereddependencies.vulnerable()
vulnerability_count = packages_qs.count() + dependencies_qs.count()
if vulnerability_count:
print(vulnerability_count, "vulnerabilities found:")
for entry in [*packages_qs, *dependencies_qs]:
print(entry)
exit(1)
else:
print("No vulnerabilities found")
exit(0)
'