Skip to content

Pull Request - Create Review Request (Single Reviewer) #3089

@nkaaf

Description

@nkaaf

Problem

I am currently facing the problem that creating a review request for only one reviewer (via string) leads to an error response from GitHub.

Test Code

pull_request = repo.create_pull(branch_base, branch_new, title=title)
pull_request.create_review_request(reviewer_name)

-> github.GithubException.GithubException: 422 {“message”: “Invalid request.\n\nFor ‘properties/reviewers’, \”reviewer_name\“ is not an array.”, 'documentation_url': “https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request”, 'status': “422”}

Changed code

pull_request = repo.create_pull(branch_base, branch_new, title=title)
pull_request.create_review_request([reviewer_name])

-> works

Suggestion

Your pull_request.create_review_request API allows you to pass the reviewer as a string and as a list, so I assume this issue can be fixed by wrapping the string to a list when a string is passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions