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