Skip to main content

Using GitHub Copilot code review on GitHub

GitHub Copilot reviews your pull requests and suggests ready-to-apply changes, so you get fast, actionable feedback on every commit.

Copilot code review is also available for organization members without a Copilot license, when enabled by an enterprise administrator or organization owner. See Copilot code review for organization members without a Copilot license.

Request a review from Copilot

  1. On GitHub.com, create or open a pull request.

  2. Open the Reviewers menu, then select Copilot.

    Screenshot of selecting 'Copilot' from the 'Reviewers' menu.

  3. Wait for Copilot to finish reviewing. This usually takes less than 30 seconds.

  4. Read through Copilot's comments on the pull request.

    Screenshot of a code review left by Copilot.

Copilot always leaves a "Comment" review, not an "Approve" or "Request changes" review. Its reviews do not count toward required approvals and will not block merging.

Copilot's review comments work like comments from human reviewers. Add reactions, reply, resolve, or hide them. Any replies you add are visible to other people but not to Copilot.

Work with suggested changes

Copilot's feedback often includes suggested changes you can apply in a few clicks. Accept a single suggestion or group multiple suggestions into one commit. For more information, see Incorporating feedback in your pull request.

To have Copilot cloud agent implement suggested changes directly:

  1. Opt into the public preview for tools in Copilot code review and enable Copilot cloud agent.
  2. On a review comment from GitHub Copilot code review, click Implement suggestion. This creates a draft comment where you instruct Copilot to address specific feedback. Copilot then creates a new pull request against your branch with the suggestions applied.

Provide feedback on reviews

Rate Copilot's comments to help improve future suggestions.

  1. On a review comment from Copilot, click the thumbs up (👍) or thumbs down (👎) button.

    Screenshot showing a Copilot code review comment with the thumbs up and thumbs down buttons.

  2. If you click thumbs down, optionally pick a reason and leave a comment, then click Submit feedback.

    Screenshot of the form for providing additional information when you give negative feedback on a comment from Copilot.

Request a re-review

Copilot does not automatically re-review when you push new changes. To request a re-review, click the button next to Copilot's name in the Reviewers menu.

When re-reviewing, Copilot may repeat previous comments, even if you resolved or downvoted them.

Enable automatic reviews

By default, you request reviews from Copilot manually on each pull request. To enable automatic reviews for all pull requests, see Configuring automatic code review by GitHub Copilot.

Customize reviews with custom instructions

You can customize Copilot code review by adding custom instructions to your repository.

Repository custom instructions can either be repository wide or path specific. You specify repository-wide custom instructions in a .github/copilot-instructions.md file in your repository. You can use this file to store information that you want Copilot to consider when reviewing code anywhere in the repository.

You can also write instructions that Copilot will only use when reviewing code in files that match a specified path. You write these instructions in one or more .github/instructions/**/*.instructions.md files.

For more information, see Adding repository custom instructions for GitHub Copilot.

Note

  • Copilot code review only reads the first 4,000 characters of any custom instruction file. Any instructions beyond this limit will not affect the reviews generated by Copilot code review. This limit does not apply to Copilot Chat or Copilot cloud agent.
  • When reviewing a pull request, Copilot uses the custom instructions in the base branch of the pull request. For example, if your pull request seeks to merge my-feature-branch into main, Copilot will use the custom instructions in main.

Example

This example of a .github/copilot-instructions.md file contains three instructions that will be applied to all Copilot code reviews in the repository.

When performing a code review, respond in Spanish.

When performing a code review, apply the checks in the `/security/security-checklist.md` file.

When performing a code review, focus on readability and avoid nested ternary operators.

Further reading