-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Pull Request - Create Review Request (Single Reviewer) #3089
Copy link
Copy link
Closed
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels