Skip to content

auth status shows "not logged into any GitHub hosts" even with GH_ENTERPRISE_TOKEN and GH_HOST #4576

@joeksy

Description

@joeksy

Describe the bug

gh version 2.1.0

Not logged in with GH_ENTERPRISE_TOKEN and GH_HOST set

Steps to reproduce the behavior

  1. Set both GH_ENTERPRISE_TOKEN and GH_HOST environment variables
  2. from cmd, type gh auth status

Expected vs actual behavior

Expected: Signed in to github enterprise host
Actual: Not logged in

Additionally: When attempting to sign in with gh auth login --hostname %GH_HOST% with be blocked due to GH_ENTERPRISE_TOKEN in use message despite being signed out

Logs

You are not logged into any GitHub hosts. Run gh auth login to authenticate.

C:\>gh auth login --hostname %GH_HOST%
The value of the GH_ENTERPRISE_TOKEN environment variable is being used for authentication.
To have GitHub CLI store credentials instead, first clear the value from the environment.```

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority-2Affects more than a few users but doesn't prevent core functions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions