Skip to content

Commit 48f5f6e

Browse files
authored
Improve SBOM handling when building Windows releases (#254)
1 parent 3a17727 commit 48f5f6e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

windows-release/checkout.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,13 @@ steps:
3535
${{ if and(parameters.Path, ne(parameters.Path, '.')) }}:
3636
workingDirectory: ${{ parameters.Path }}
3737
condition: and(succeeded(), variables['SourceCommit'])
38+
39+
- powershell: |
40+
if (-not (Test-Path "Misc\externals.spdx.json")) {
41+
"externals.spdx.json is missing - skipping SBOM"
42+
Write-Host "##vso[task.setvariable variable=SkipSBOM]1"
43+
}
44+
displayName: 'Checking for SBOM inputs'
45+
${{ if and(parameters.Path, ne(parameters.Path, '.')) }}:
46+
workingDirectory: ${{ parameters.Path }}
47+
condition: and(succeeded(), not(variables['SkipSBOM']))

windows-release/stage-layout-embed.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595

9696
- task: PublishBuildArtifacts@1
9797
displayName: 'Publish Artifact: sbom'
98+
condition: and(succeeded(), not(variables['SkipSBOM']))
9899
inputs:
99100
PathtoPublish: $(Build.ArtifactStagingDirectory)\sbom
100101
ArtifactName: sbom

0 commit comments

Comments
 (0)