-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issuehelp wantedContributions welcomeContributions welcomepriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic
Description
Describe the bug
For a new user setup, I run gh auth status -h github.example.com to check if a user has setup the CLI tool. I expect this to fail because ~/.config/gh/hosts.yml has no entry for github.example.com. However, it prints no stdout and exits with 0.
Note: gh auth status, which uses github.com by default, will fail if ~/.config/gh/hosts.yml does not exist.
Steps to reproduce the behavior
rm -rf ~/.config/ghexport GITHUB_TOKEN=asdfgh auth status -h <github-host> # where <github-host> is anything other than 'github.com'
Expected vs actual behavior
Expected:
$ gh auth status -h github.example.com
github.example.com
X github.example.com: authentication failed
- The github.example.com token in GITHUB_TOKEN is no longer valid.
$ echo $?
1
Alternate expected behavior:
$ gh auth status -h github.example.com
You are not logged into any GitHub hosts. Run gh auth login to authenticate.
$ echo $?
1
Actual:
$ gh auth status -h github.ibm.com
$ echo $?
0
Note: if I unset GITHUB_TOKEN, gh auth status -h github.example.com outputs "You are not logged into any GitHub hosts. Run gh auth login to authenticate".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issuehelp wantedContributions welcomeContributions welcomepriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic