Repository navigation
gh wants GH_TOKEN env variable even when logged in #8347
|
I used $ gh version
gh version 2.39.0 (1980-01-01)
https://github.com/cli/cli/releases/tag/v2.39.0
$ gh auth status
You are not logged into any GitHub hosts. Run gh auth login to authenticate.
$ GH_TOKEN=$(gh auth token) gh auth status
github.com
✓ Logged in to github.com as twz123 (GH_TOKEN)
✓ Git operations for github.com configured to use https protocol.
✓ Token: gho_************************************
✓ Token scopes: ...Is that intended behavior? I feel that I'm missing something here? |
Answered by
andyfeller
Nov 17, 2023
Replies: 2 comments 7 replies
|
@twz123 : thanks for opening up this discussion! 🙇 This is really odd behavior, I want to dig into this a little bit more. Additionally, I see the build date in While I look into why this might be happening for
|
7 replies
This comment was marked as spam.
This comment was marked as spam.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would you mind reviewing the state of your
~/.local/gh/hosts.ymlfile and sharing what makes sense? Also have you tried re-authenticating withgh auth login?As you'll see below, this file contains information the hosts you are authenticated with. Because there might be information about unsecure OAuth token or keychain location, I encourage you to look at it yourself and share what makes sense.
I think you might have an empty hosts file but you have a token stored in the location of the default host keyring.
Digging into the code
cli/clisidegh auth statusis pulling host information from configuration, which is managed bycli/go-ghlibrary:cli/pkg/cmd/auth/status/status.go
Lines …