diff --git a/Sbom.yml b/Sbom.yml index 08a7235..3124493 100644 --- a/Sbom.yml +++ b/Sbom.yml @@ -33,10 +33,12 @@ steps: # This will break signing, but it is currently not enabled. - pwsh: | $manifestPath = Join-Path '${{ parameters.BuildDropPath }}' -ChildPath '_manifest\manifest.json' - Write-Verbose "manifestPath: $manifestPath" -verbose - $manifest = Get-Content $manifestPath | ConvertFrom-Json - Write-Verbose "oldRepo: $($manifest.Repo)" -verbose - $manifest.Repo = '${{ parameters.Build_Repository_Uri}}' - Write-Verbose "newRepo: $($manifest.Repo)" -verbose - $manifest | convertto-json -Compress | Out-File -FilePath $manifestPath -Force + if (Test-Path $manifestPath) { + Write-Verbose "manifestPath: $manifestPath" -verbose + $manifest = Get-Content $manifestPath | ConvertFrom-Json + Write-Verbose "oldRepo: $($manifest.Repo)" -verbose + $manifest.Repo = '${{ parameters.Build_Repository_Uri}}' + Write-Verbose "newRepo: $($manifest.Repo)" -verbose + $manifest | convertto-json -Compress | Out-File -FilePath $manifestPath -Force + } else { Write-Verbose "cloudbuild manifest doesn't exist" -verbose" } displayName: '${{ parameters.displayName }} - Fix repo'