-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Describe the bug
So I have a GITHUB_TOKEN containing a PAT for my personal github account used by other tooling to access the public github API (i.e. fetching releases in mise, etc.)
But my copilot CLI is logged in to GitHub Enterprise .ghe.com
What I've found is that the copilot CLI will always prefer to use the PAT from GITHUB_TOKEN instead of the oauth credential it should have for GitHub enterprise. This results in it just failing to work outright because my personal token does not have copilot permission, or a copilot subscription.
Affected version
GitHub Copilot CLI 0.0.417
Steps to reproduce the behavior
- Have a GITHUB_TOKEN environment variable containing a PAT with minimal permissions (i.e. only public repo access)
- Log in to copilot CLI using /login using a GHE account.
- Close and restart copilot CLI
- Attempt to use /model and see it complaining that the token doesn't have permissions.
- Do /user switch to another "user" that actually has permissions
- Now it actually works.
Expected behavior
I would expect it to prefer the credential that actually works.
Or allow me to explicitly set a default user here.
Additional context
No response
Reactions are currently unavailable