From 12a08b6a9bc4aab6cd2141054435f67291eb201d Mon Sep 17 00:00:00 2001 From: Francisco Gamino Date: Tue, 14 Mar 2023 11:02:36 -0700 Subject: [PATCH] Update logic to set shouldAddSBOM (#928) --- azure-pipelines.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b271f9f2..a4175c3f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -44,7 +44,20 @@ steps: - pwsh: | $ErrorActionPreference = "Stop" - $shouldAddSBOM = [bool]"$(IsReleaseBuild)" + + $shouldAddSBOM = $null + if ([string]::IsNullOrEmpty($IsReleaseBuild)) + { + Write-Host "IsReleaseBuild is null or empty. Setting shouldAddSBOM to false" + $shouldAddSBOM = $false + } + else + { + Write-Host "IsReleaseBuild: $IsReleaseBuild" + $shouldAddSBOM = ($IsReleaseBuild -eq "true") + } + + Write-Host "shouldAddSBOM: $shouldAddSBOM" ./build.ps1 -Clean -Configuration Release -BuildNumber "$(buildNumber)" -AddSBOM:$shouldAddSBOM -SBOMUtilSASUrl "$(SBOMUtilSASUrl)" displayName: 'Build worker code'