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 <raychen@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Azure SDK Bot 2025-05-15 15:59:55 -07:00 committed by GitHub
parent 6b591a8a12
commit 5d4324dd7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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