-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Describe the bug
When running gh auth login and it uploads the SSH key to the account, if it's already registered on another account it just proceeds without error.
Steps to reproduce the behavior
- Generate an SSH key
- Create an account, and upload the ssh key
- Create another account, and run
gh auth login - Upload the same SSH key that's already on another account
Expected vs actual behavior
Expected: An error is generated showing "Key is already in use", remove from other account or use a different key.
Logs
> gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations? SSH
? Upload your SSH public key to your GitHub account? id_rsa.pub
? How would you like to authenticate GitHub CLI? Login with a web browser
! First copy your one-time code: A2F6-B5E3
- Press Enter to open github.com in your browser...
✓ Authentication complete. Press Enter to continue...
- gh config set -h github.com git_protocol ssh
✓ Configured git protocol
✓ Uploaded the SSH key to your GitHub account: id_rsa.pub
✓ Logged in as account