-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When trying to use gh pr checkout, I was prompted to re-auth to add the read:org scope to the OAuth(?) app's permissions. After successfully completing that flow, the CLI still error'd thinking it's still lacking the required scopes.
A second attempt at the same command worked without any problems
Expected vs actual behavior
- Given the CLI OAuth does not have the
read:orgscope - When using
gh pr checkoutcommand to checkout a PR locally - And successfully completing the automatic re-auth flow in the browser to add the missing scope
- Then it should correctly continue with the checkout flow
Instead, it failed with an error.
Logs
$ gh pr checkout https://github.com/<org>/<repo>/pull/123
Notice: additional authorization required
Press Enter to open github.com in your browser...
Authentication complete. Press Enter to continue...
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.'
$ gh pr checkout https://github.com/<org>/<repo>/pull/123
Switched to a new branch 'feature/add-deploy-readme'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working