Skip to content

Support GitHub Teams in requested reviewers metada #812

@doi-t

Description

@doi-t

Describe the feature or problem you’d like to solve

I tried to support teams among requested reviewers with the following GraphQL query.

reviewRequests(first: 100) {
	nodes {
		requestedReviewer {
			__typename
			...on User {
				login
			}
			...on Team {
				name
			}
		}
	}
	totalCount
}

However, auth token does not have 'read:org' and 'read:discussion' permissions.

$ gh pr view 1 --repo cli-test-org/cli-test
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.'

Proposed solution

I wonder if #786 can solve this problem. According to the error message, we also need read:discussion to query a team's name in requested reviewers.

Additional context

This is a contentious work of #663 requested at #762 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLI

    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