Skip to content

Commit 372c7ab

Browse files
authored
fix: add some backwards compatibility (#115)
We changed from "triage_input_file" to "vex_file" in #110 but didn't leave backwards compatibility shims in for folk using the old tag. Signed-off-by: Terri Oda <[email protected]>
1 parent 3cd5e77 commit 372c7ab

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/cve_bin_tool.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def scan(
3434
sbom_format="json",
3535
sbom_output="SBOM.json",
3636
vex_file=None,
37+
triage_input_file=None,
3738
):
3839
json_data = []
3940
captured_output = ""
@@ -67,6 +68,10 @@ def scan(
6768
if vex_file and Path(vex_file).exists():
6869
command.append("--vex-file")
6970
command.append(vex_file)
71+
elif triage_input_file and Path(triage_input_file).exists():
72+
# Backwards compatibility with old arg name
73+
command.append("--vex-file")
74+
command.append(triage_input_file)
7075
if filter_triage:
7176
command.append("--filter-triage")
7277
captured_output += subprocess.run(

src/scanner.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ def main():
7676
help="Filter vulnerabilities based on triage data.",
7777
required=False,
7878
)
79+
parser.add_argument(
80+
"--triage-input-file",
81+
help="(Deprecated) Use --vex-file instead.",
82+
required=False,
83+
)
7984

8085
args = parser.parse_args()
8186
# workaround for args from action.yml being passed as string instead of boolean
@@ -92,6 +97,10 @@ def main():
9297
cve_bin_tool = CVE_BIN_TOOL()
9398
cve_bin_tool.update_db(args.nvd_api_key)
9499

100+
# backwards compatibility for folk still using triage-input-file instead of vex-file
101+
if args.triage_input_file and not args.vex_file:
102+
args.vex_file = args.triage_input_file
103+
95104
if not args.sbom_type:
96105
args.sbom_type = "spdx"
97106
if not args.sbom_format:

0 commit comments

Comments
 (0)