Skip to content

Commit d2f249d

Browse files
committed
Merged PR 30665: [release/v7.2.19] Verify environment variable for OneBranch before we try to copy (#21441)
Verify environment variable for OneBranch before we try to copy (#21441)
1 parent f386a91 commit d2f249d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tools/releaseBuild/setReleaseTag.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,20 @@ function New-BuildInfoJson {
4848
Write-Verbose -Message "$vstsCommandString" -Verbose
4949
Write-Host -Object "##$vstsCommandString"
5050

51+
# Upload for ADO pipelines
52+
Write-Host "##vso[artifact.upload containerfolder=BuildInfoJson;artifactname=BuildInfoJson]$resolvedPath"
53+
54+
# Copy to location where OneBranch Pipelines uploads from
55+
56+
# if the environment variable does not exist, we are not in OneBranch. So just return.
57+
if (-not $env:ob_outputDirectory) {
58+
return
59+
}
60+
5161
if (-not (Test-Path $env:ob_outputDirectory)) {
5262
$null = New-Item -Path $env:ob_outputDirectory -ItemType Directory -Force -Verbose
5363
}
5464

55-
# Upload for ADO pipelines
56-
Write-Host "##vso[artifact.upload containerfolder=BuildInfoJson;artifactname=BuildInfoJson]$resolvedPath"
57-
# Copy to location where OneBranch Pipelines uploads from
5865
Copy-Item $resolvedPath -Destination $env:ob_outputDirectory -Force -Verbose
5966
}
6067

0 commit comments

Comments
 (0)