gh auth login: added flags to partially automate flow#5158
Conversation
|
Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message. |
|
Hi, thanks for maintaining a tool that wraps gh! For clarification: |
96b773d to
1fd42ce
Compare
That is correct. |
mislav
left a comment
There was a problem hiding this comment.
Thank you! I've pushed some tweaks to simplify.
Motivation: I maintain a tool that implements a specific workflow using git and gh. A few of my users were
confused by the various options presented by the "gh auth login" flow, so I would like to add these command
line flags that can be optionally used to reduce the number of prompts the user is shown.
For example, if I know that I want all my users to not use GitHub Enterprise, and to use SSH to authenticate to
git, then my wrapper tool would run:
Then the users are only prompted for the remaining necessary items.
I also modified the flow so that if web-based authentication fails (ie if the user is trapped in text mode),
gh auth loginautomatically falls over to prompting the user to paste a token. This step, too, will reduce the number of support calls I have to respond to by one.Tested by recompiling and manually retesting the gh tool.