-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignoring default auth in codespaces for ghcli and gitcli #1970
Conversation
Looks good to me overall. Just want to clarify around the need for setting the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small nits and ideas on how we might simplify this a little more, but happy overall!
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSIContainer
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference (preview)
|
fix: #1938
This PR updates the ghcli tool within azd to ignore the default auth provided by GitHub when launching a codespace.
By ignoring the default auth, azd will ask user to login to GitHub and request
repo
andworkflow
scopes.These scopes will ensure ghcli can create new repos and
git
can push new workflows.After login with ghcli, azd sets a git credential helper within the repo local settings to use the
gh auth
as credential helper.This will make all calls to
git
from the project folder to authenticate to GitHub.com using the gh-cli, which has a token for scopesrepo
andworkflows
, so the user won't have any issue for pushing the code at the end ofazd pipeline config
Notes:
gh cli
installed locally or inside the codespace, azd will use its own copy ofgh cli
to elevate the scope access as required byazd pipeline config
. Users will continue to use the auth provided by GitHub while they keep the GITHUB_TOKEN env var.