SIGN IN SIGN UP

Create Review Request - transform string params to a list (#3099)

### Problem
`pull_request.create_review_request(reviewers="some-reviewer")` raises a
`GithubException` if a single reviewer is provided as a string. This
occurs because GitHub expects the reviewers property to be an array, not
a single string ([Github
docs](https://docs.github.com/en/rest/pulls/review-requests?apiVersion=2022-11-28#request-reviewers-for-a-pull-request)).

Exception example:
```
github.GithubException.GithubException: 422 {"message": "Invalid request.
For 'properties/reviewers', \"some-reviewer\" is not an array.", "documentation_url": "https://docs.github.com/rest/pulls/review-requests#request-reviewers-for-a-pull-request", "status": "422"}
```

### Fix
Wrap the string arguments (`reviewers`, `team_reviewers`) into a list
when a single reviewer is provided. This ensures compatibility with
GitHub's API, which expects the reviewers property to always be an
array.

Fixes https://github.com/PyGithub/PyGithub/issues/3089

---------

Co-authored-by: Enrico Minack <github@enrico.minack.dev>
A
a-sido committed
8aef11c04640111398eb1eb819c392efcff04499
Parent: 4d307a7
Committed by GitHub <noreply@github.com> on 2/14/2025, 7:38:07 PM