File tree Expand file tree Collapse file tree 1 file changed +5
-20
lines changed
Expand file tree Collapse file tree 1 file changed +5
-20
lines changed Original file line number Diff line number Diff line change @@ -13,27 +13,12 @@ jobs:
1313 sparse-checkout : pyproject.toml
1414 sparse-checkout-cone-mode : false
1515
16- - uses : aboutcode-org/scancode-action@main
16+ - name : Fail on known vulnerabilities
17+ uses : aboutcode-org/scancode-action@main
1718 with :
1819 pipelines : " inspect_packages:StaticResolver,find_vulnerabilities"
20+ check-compliance : true
21+ compliance-fail-on-vulnerabilities : true
22+ scancodeio-repo-branch : " main"
1923 env :
2024 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