-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
authrelated to tokens, authentication state, or oauthrelated to tokens, authentication state, or oauthbugSomething isn't workingSomething isn't workingpriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
Description
#976 taught gh to respect the GITHUB_TOKEN environment variable. Unfortunately, I already use this environment variable for other tools, and as such it has the absolute minimum set of scopes attached to it for security purposes.
Now that gh has started use this environment variable, I'm getting the following error:
Warning: gh now requires the `read:org` OAuth scope.
Visit https://github.com/settings/tokens and edit your token to enable `read:org`
or generate a new token for the GITHUB_TOKEN environment variable
graphql error: 'Your token has not been granted the required scopes to execute this query. The 'name' field requires one of the following scopes: ['read:org', 'read:discussion'], but your token has only been granted the: ['repo'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens.'
I don't want to grant this token additional scopes because it is not required for the other tools that use it.
Possible solutions:
- Rename
GITHUB_TOKENtoGITHUB_GH_TOKENand avoid clashes altogether - Unset
GITHUB_TOKENto allow OAuth flow to take precedence (i.e. create a wrapper script which invokesGITHUB_TOKEN= command gh "$@") - Let the user specify which auth method should take precedence – in my case, I specifically do not want to use the
GITHUB_TOKENmethod
Thoughts?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
authrelated to tokens, authentication state, or oauthrelated to tokens, authentication state, or oauthbugSomething isn't workingSomething isn't workingpriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions