Skip to content

Commit cd3655c

Browse files
authored
Use template condition instead of runtime condition (#5603)
"cpp Resource Group" is only available for internal builds so we need to condition this entire step out on non-internal builds.
1 parent 9e80a87 commit cd3655c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

eng/pipelines/templates/steps/vcpkg.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ steps:
44
Write-Host "##vso[task.setvariable variable=X_VCPKG_ASSET_SOURCES_SECRET;issecret=true;]clear;x-azurl,https://cppvcpkgcache.blob.core.windows.net/public-vcpkg-asset-container/,,read"
55
displayName: Set Vcpkg Variables
66
7-
- task: AzurePowerShell@5
8-
displayName: Set Vcpkg Write-mode Cache
9-
condition: and(succeeded(), eq(variables['System.TeamProject'], 'internal'))
10-
inputs:
11-
azureSubscription: 'cpp Resource Group'
12-
ScriptType: FilePath
13-
ScriptPath: eng/scripts/Set-VcpkgWriteModeCache.ps1
14-
azurePowerShellVersion: LatestVersion
15-
pwsh: true
7+
- ${{if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
8+
- task: AzurePowerShell@5
9+
displayName: Set Vcpkg Write-mode Cache
10+
inputs:
11+
azureSubscription: 'cpp Resource Group'
12+
ScriptType: FilePath
13+
ScriptPath: eng/scripts/Set-VcpkgWriteModeCache.ps1
14+
azurePowerShellVersion: LatestVersion
15+
pwsh: true

0 commit comments

Comments
 (0)