mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
Dont scan grype itself with grype
This commit is contained in:
10
.github/workflows/ci.py
vendored
10
.github/workflows/ci.py
vendored
@@ -196,7 +196,7 @@ def install_bundle(dest: str = '', which: str = '') -> None:
|
|||||||
|
|
||||||
|
|
||||||
def install_grype() -> str:
|
def install_grype() -> str:
|
||||||
dest = os.path.join(SW, 'bin')
|
dest = '/tmp'
|
||||||
rq = Request('https://api.github.com/repos/anchore/grype/releases/latest', headers={
|
rq = Request('https://api.github.com/repos/anchore/grype/releases/latest', headers={
|
||||||
'Accept': 'application/vnd.github.v3+json',
|
'Accept': 'application/vnd.github.v3+json',
|
||||||
})
|
})
|
||||||
@@ -240,8 +240,8 @@ def check_dependencies() -> None:
|
|||||||
os.makedirs(dest, exist_ok=True)
|
os.makedirs(dest, exist_ok=True)
|
||||||
install_bundle(dest, os.path.basename(dest))
|
install_bundle(dest, os.path.basename(dest))
|
||||||
cmdline = [grype, '--by-cve', '--config', gc, '--fail-on', 'medium', '--only-fixed', '--add-cpes-if-none']
|
cmdline = [grype, '--by-cve', '--config', gc, '--fail-on', 'medium', '--only-fixed', '--add-cpes-if-none']
|
||||||
if (cp := subprocess.run(cmdline + ['dir:' + SW])).returncode != 0:
|
if (subprocess.run(cmdline + ['dir:' + SW])).returncode != 0:
|
||||||
raise SystemExit(cp.returncode)
|
raise SystemExit('grype found problems during filesystem scan')
|
||||||
# Now test against the SBOM
|
# Now test against the SBOM
|
||||||
import runpy
|
import runpy
|
||||||
orig = sys.argv, sys.stdout
|
orig = sys.argv, sys.stdout
|
||||||
@@ -251,8 +251,8 @@ def check_dependencies() -> None:
|
|||||||
runpy.run_path('bypy-src')
|
runpy.run_path('bypy-src')
|
||||||
sys.argv, sys.stdout = orig
|
sys.argv, sys.stdout = orig
|
||||||
print(buf.getvalue())
|
print(buf.getvalue())
|
||||||
if (cp := subprocess.run(cmdline, input=buf.getvalue().encode())).returncode != 0:
|
if (subprocess.run(cmdline, input=buf.getvalue().encode())).returncode != 0:
|
||||||
raise SystemExit(cp.returncode)
|
raise SystemExit('grype found problems during SBOM scan')
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user