Skip to content

Commit 3722179

Browse files
bin: fix pre-commit to run from test container
1 parent 250cbba commit 3722179

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,22 @@ repos:
9595
types: [shell]
9696
language: script
9797
require_serial: true
98-
entry: scripts/sbom/sbom.bash diff
98+
entry: scripts/sbom/sbom.bash
99+
args:
100+
- diff
99101

100102
- id: sbom-validate
101103
name: SBOM CycloneDX validation
102104
types: [shell]
103105
language: script
104106
require_serial: true
105-
entry: scripts/sbom/sbom.bash validate
107+
entry: scripts/run-from-container.sh
108+
args:
109+
- --network=none
110+
- docker.io/cyclonedx/cyclonedx-cli:0.27.2
111+
- validate
112+
- --input-file
113+
- docs/sbom.json
106114

107115
# - id: sbom-get-unset
108116
# name: SBOM get unset

scripts/sbom/sbom.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ usage() {
3737
echo "COMMANDS:" >&2
3838
echo " add <location> <key> <value> [property-value] add key-value pair to a component" >&2
3939
echo " diff checks if any changes in git requires sbom to be updated" >&2
40-
echo " edit <location> <key> edit object under key for a component using $EDITOR" >&2
40+
echo " edit <location> <key> edit object under key for a component using ${EDITOR:-}" >&2
4141
echo " generate generate new cyclonedx sbom. Requires GITHUB_TOKEN to be set to avoid GitHub rate limits" >&2
4242
echo " get <location> [key] get component from sbom, optionally query for a provided key" >&2
4343
echo " get-charts get all charts in sbom" >&2

0 commit comments

Comments
 (0)