From 5d4324dd7d5f37a5967604505da3f463275a49f5 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 15 May 2025 15:59:55 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 10664 (#6576) * Add option to perserve auth * Update eng/common/pipelines/templates/steps/sparse-checkout.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: ray chen Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- eng/common/pipelines/templates/steps/sparse-checkout.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/steps/sparse-checkout.yml b/eng/common/pipelines/templates/steps/sparse-checkout.yml index d3992a85e..d7f1bc0d1 100644 --- a/eng/common/pipelines/templates/steps/sparse-checkout.yml +++ b/eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -14,6 +14,9 @@ parameters: - name: TokenToUseForAuth type: string default: '' + - name: PreserveAuthToken + type: boolean + default: false steps: - ${{ if not(parameters.SkipCheckoutNone) }}: @@ -137,7 +140,7 @@ steps: pwsh: true workingDirectory: $(System.DefaultWorkingDirectory) - - ${{ if ne(parameters.TokenToUseForAuth, '') }}: + - ${{ if and(ne(parameters.TokenToUseForAuth, ''), not(parameters.PreserveAuthToken)) }}: - pwsh: | git config unset --global "http.extraheader" displayName: Removing git config auth header