diff --git a/windows-release/checkout.yml b/windows-release/checkout.yml index 6a69fbef..b2aa190d 100644 --- a/windows-release/checkout.yml +++ b/windows-release/checkout.yml @@ -35,3 +35,13 @@ steps: ${{ if and(parameters.Path, ne(parameters.Path, '.')) }}: workingDirectory: ${{ parameters.Path }} condition: and(succeeded(), variables['SourceCommit']) + +- powershell: | + if (-not (Test-Path "Misc\externals.spdx.json")) { + "externals.spdx.json is missing - skipping SBOM" + Write-Host "##vso[task.setvariable variable=SkipSBOM]1" + } + displayName: 'Checking for SBOM inputs' + ${{ if and(parameters.Path, ne(parameters.Path, '.')) }}: + workingDirectory: ${{ parameters.Path }} + condition: and(succeeded(), not(variables['SkipSBOM'])) diff --git a/windows-release/stage-layout-embed.yml b/windows-release/stage-layout-embed.yml index bdd3b4e9..8910b533 100644 --- a/windows-release/stage-layout-embed.yml +++ b/windows-release/stage-layout-embed.yml @@ -95,6 +95,7 @@ jobs: - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: sbom' + condition: and(succeeded(), not(variables['SkipSBOM'])) inputs: PathtoPublish: $(Build.ArtifactStagingDirectory)\sbom ArtifactName: sbom