File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Find dependencies vulnerabilities
2+
3+ on : [push]
4+
5+ jobs :
6+ scan-codebase :
7+ runs-on : ubuntu-24.04
8+ name : Inspect packages with ScanCode.io
9+ steps :
10+ - uses : actions/checkout@v4
11+ with :
12+ path : scancode-inputs
13+ sparse-checkout : setup.cfg
14+ sparse-checkout-cone-mode : false
15+
16+ - uses : nexB/scancode-action@alpha
17+ with :
18+ pipelines : " inspect_packages:StaticResolver,find_vulnerabilities"
19+ env :
20+ VULNERABLECODE_URL : https://public.vulnerablecode.io/
21+
22+ - name : Fail in case of vulnerabilities
23+ shell : bash
24+ run : |
25+ scanpipe shell --command '
26+ from scanpipe.models import Project
27+ project = Project.objects.get()
28+ packages_qs = project.discoveredpackages.vulnerable()
29+ dependencies_qs = project.discovereddependencies.vulnerable()
30+ vulnerability_count = packages_qs.count() + dependencies_qs.count()
31+ if vulnerability_count:
32+ print(vulnerability_count, "vulnerabilities found:")
33+ for entry in [*packages_qs, *dependencies_qs]:
34+ print(entry)
35+ exit(1)
36+ else:
37+ print("No vulnerabilities found")
38+ exit(0)
39+ '
You can’t perform that action at this time.
0 commit comments