How do I programmatically add Copilot as reviewer to a PR? #157751
Select Topic AreaQuestion BodyI am using https://docs.github.com/en/rest/pulls/review-requests?apiVersion=2022-11-28#request-reviewers-for-a-pull-request to add revuiewers. I would like to add Copilot as well, but that does not work if I use "Copilot". What is the correct ID to use? Or is this not supported? |
Replies: 5 comments 2 replies
|
Hey @SergeyBarskiyTyler 👋 Currently, GitHub Copilot is not a user or entity that can be added as a reviewer to a pull request. The GitHub API for requesting reviewers only supports adding individual users or teams as reviewers. However if Copilot's automatic code review is enabled, it will automatically review pull requests that meet the configured criteria, regardless of whether the PR is created via the GitHub UI or the API. Hope that helps. |
|
Is there any plan of adding this feature ? |
|
hallooooo, any movement here??, guess not... |
|
GitHub Copilot cannot be added as a reviewer to a pull request, either through the GitHub UI or programmatically. The Request Reviewers API only supports valid GitHub usernames or team slugs. Since Copilot is not a GitHub user or team, it cannot be assigned as a reviewer. If you want Copilot to review pull requests, you need to enable Copilot’s automatic code review feature in your repository or organization settings. Once enabled, Copilot will automatically review pull requests based on the configured rules. One thing to note is that Copilot reviews are typically triggered after a new commit is pushed to an existing pull request, not when the pull request is first created. Because of this, Copilot will not appear as a reviewer when the PR is opened. In practice: Use the API to request reviews from users or teams. Enable Copilot automatic code review in repository or organization settings. Copilot reviews will run automatically when new commits are pushed to the PR. |
|
Feature added. |
Hey @SergeyBarskiyTyler 👋
Currently, GitHub Copilot is not a user or entity that can be added as a reviewer to a pull request. The GitHub API for requesting reviewers only supports adding individual users or teams as reviewers.
However if Copilot's automatic code review is enabled, it will automatically review pull requests that meet the configured criteria, regardless of whether the PR is created via the GitHub UI or the API. Hope that helps.