Fix Submit-AzureSdkForNetPr.ps1 push auth for GitHub App installation tokens#10710
Open
JoshLove-msft wants to merge 1 commit into
Open
Conversation
…tokens PR microsoft#10594 transitioned the publish pipeline from a static PAT (azuresdk-github-pat) to a GitHub App installation token minted via login-to-github.ps1. Installation tokens (ghs_*) cannot be used in the bare 'https://TOKEN@github.com/' form ΓÇö git treats the token as the username and prompts for a password, producing: fatal: could not read Password for 'https://***@github.com': terminal prompts disabled Switch the push URL to 'https://x-access-token:TOKEN@github.com/' which works for both classic PATs and GitHub App installation tokens. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
commit: |
Contributor
|
No changes needing a change description found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#10594 transitioned the publish pipeline from a static PAT (
azuresdk-github-pat) to a GitHub App installation token minted viaeng/common/scripts/login-to-github.ps1. The token is then passed intoSubmit-AzureSdkForNetPr.ps1as-AuthToken '$(GH_TOKEN)'.The script builds the push URL like this:
That bare-token form works with classic PATs (GitHub accepts username=PAT, empty password) but fails with GitHub App installation tokens (
ghs_*). git treats the token as the username and prompts for a password, producing the failure observed in the latest pipeline run:Fix
Use the
x-access-tokenusername scheme, which is the documented form that works for both classic PATs and GitHub App installation tokens:One-line change. No behavior difference for the previous PAT path.