Skip to content

Commit 5c8e0cc

Browse files
fix(sbom): handle user adding v as prefix to version
1 parent ece5977 commit 5c8e0cc

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/sbom/install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ validate_version_exists() {
4141
# make sure we have curl
4242
check_packages curl jq ca-certificates libicu-dev
4343

44+
# Normalize version: add 'v' prefix if missing
45+
if [ "${SBOM_TOOL_VERSION}" != "latest" ] && [[ "${SBOM_TOOL_VERSION}" != v* ]]; then
46+
SBOM_TOOL_VERSION="v${SBOM_TOOL_VERSION}"
47+
fi
48+
4449
# make sure version is available
4550
if [ "${SBOM_TOOL_VERSION}" = "latest" ]; then SBOM_TOOL_VERSION=$(curl -sL https://api.github.com/repos/microsoft/sbom-tool/releases/latest | jq -r ".tag_name"); fi
4651
validate_version_exists SBOM_TOOL_VERSION "${SBOM_TOOL_VERSION}"

test/sbom/install_sbom_specific_version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Scenario: install_sbom_specific_version
4-
# Verifies that a specific version of sbom-tool (0.3.3) installs correctly
4+
# Verifies that a specific version of sbom-tool (2.2.5) installs correctly
55

66
set -e
77

test/sbom/scenarios.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
1212
"features": {
1313
"sbom": {
14-
"version": "0.3.3"
14+
"version": "2.2.5"
1515
}
1616
}
1717
},

0 commit comments

Comments
 (0)