shell-plugins icon indicating copy to clipboard operation
shell-plugins copied to clipboard

Adding scopes to the GitHub token for gh auth

Open tmcw opened this issue 1 year ago • 1 comments
trafficstars

Platform or tool

GitHub

Desired or expected behavior

I want to use the Octo neovim plugin, which requires the read:project scope. It recommends I run gh auth refresh -s read:project to add that scope.

Current behavior

I cannot, because that token is being set by op and can't be overridden easily

➜ gh auth refresh -s read:project
The value of the GITHUB_TOKEN environment variable is being used for authentication.
To refresh credentials stored in GitHub CLI, first clear the value from the environment.

Trying to set that token to false in the command doesn't work:

❯ GITHUB_TOKEN="" gh auth refresh -s read:project
The value of the GITHUB_TOKEN environment variable is being used for authentication.
To refresh credentials stored in GitHub CLI, first clear the value from the environment.

I don't know of another workaround. How do I add a scope to the token that op injects into gh?

Relevant log output

No response

op CLI version

2.17.0

tmcw avatar Aug 27 '24 16:08 tmcw

Yikes, is that user sharing some exploit? I can't report comments because this isn't my repo, but if it isn't obvious, don't click that link. (I've reported this user and others who appear to be part of the same botnet and are posting the same comment verbatim across repos, as well as reported the link to bit.ly)

tmcw avatar Aug 27 '24 16:08 tmcw