From d94ab074341d312569aab3d1f10f5f5f1d85dd7c Mon Sep 17 00:00:00 2001 From: Francisco-Gamino Date: Tue, 14 Mar 2023 10:18:26 -0700 Subject: [PATCH] Update logic to set shouldAddSBOM --- azure-pipelines.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 51c6f2a2..ff471dba 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'