From 7004f4515f1b7e61fd4fde448aac778d4f1bea86 Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Tue, 13 Apr 2021 14:07:28 +1000 Subject: [PATCH 1/2] Remove condition. --- eng/common/pipelines/templates/steps/retain-run.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/retain-run.yml b/eng/common/pipelines/templates/steps/retain-run.yml index 0ba622dcff85..1162279831aa 100644 --- a/eng/common/pipelines/templates/steps/retain-run.yml +++ b/eng/common/pipelines/templates/steps/retain-run.yml @@ -6,7 +6,6 @@ parameters: steps: - task: PowerShell@2 displayName: Retain pipeline run - condition: ${{ parameters.Condition }} inputs: pwsh: true filePath: $(Build.SourcesDirectory)/eng/common/scripts/Add-RetentionLease.ps1 From 635d9e5bf41703e7ea4817e65a2432c526dc9dbd Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Tue, 13 Apr 2021 14:13:09 +1000 Subject: [PATCH 2/2] Fix up system access token usage. --- eng/common/pipelines/templates/steps/retain-run.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/retain-run.yml b/eng/common/pipelines/templates/steps/retain-run.yml index 1162279831aa..a514b90f2291 100644 --- a/eng/common/pipelines/templates/steps/retain-run.yml +++ b/eng/common/pipelines/templates/steps/retain-run.yml @@ -6,6 +6,8 @@ parameters: steps: - task: PowerShell@2 displayName: Retain pipeline run + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) inputs: pwsh: true filePath: $(Build.SourcesDirectory)/eng/common/scripts/Add-RetentionLease.ps1 @@ -16,5 +18,5 @@ steps: -RunId $(Build.BuildId) -OwnerId Pipeline -DaysValid ${{parameters.DaysValid}} - -Base64EncodedAuthToken $(System.AccessToken) + -Base64EncodedAuthToken $env:SYSTEM_ACCESSTOKEN -Debug \ No newline at end of file