From cd3655c3220fc0524496a8d1470515de23a007d2 Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Tue, 7 May 2024 13:58:10 -0700 Subject: [PATCH] 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. --- eng/pipelines/templates/steps/vcpkg.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/eng/pipelines/templates/steps/vcpkg.yml b/eng/pipelines/templates/steps/vcpkg.yml index 86bb3ef2e..e0beab233 100644 --- a/eng/pipelines/templates/steps/vcpkg.yml +++ b/eng/pipelines/templates/steps/vcpkg.yml @@ -4,12 +4,12 @@ steps: 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" displayName: Set Vcpkg Variables - - task: AzurePowerShell@5 - displayName: Set Vcpkg Write-mode Cache - condition: and(succeeded(), eq(variables['System.TeamProject'], 'internal')) - inputs: - azureSubscription: 'cpp Resource Group' - ScriptType: FilePath - ScriptPath: eng/scripts/Set-VcpkgWriteModeCache.ps1 - azurePowerShellVersion: LatestVersion - pwsh: true + - ${{if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - task: AzurePowerShell@5 + displayName: Set Vcpkg Write-mode Cache + inputs: + azureSubscription: 'cpp Resource Group' + ScriptType: FilePath + ScriptPath: eng/scripts/Set-VcpkgWriteModeCache.ps1 + azurePowerShellVersion: LatestVersion + pwsh: true