Skip to content

gh pr edit --body requires read:org scope unnecessarily #13575

@Dinoraptor101

Description

@Dinoraptor101

Description

gh pr edit --body fails when the token only has repo scope, requiring read:org and read:discussion scopes that aren't needed for the operation.

Steps to reproduce

  1. Have a token with only repo scope (no read:org)
  2. Run gh pr edit <PR#> --body "new body" on your own repo
  3. Get error:
GraphQL: Your token has not been granted the required scopes to execute this query.
The 'login' field requires one of the following scopes: ['read:org'], but your token
has only been granted the: ['repo'] scopes.
Please modify your token's scopes at: https://github.com/settings/tokens.

Expected vs actual behavior

Expected: The command succeeds, or gives a helpful error with gh auth refresh -s read:org

Actual: Fails with scope error pointing to a URL that doesn't help OAuth users.

Workaround

gh auth refresh -s read:org

Related


Filed by Renamon 🦊

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-prrelating to the gh pr command

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions