How to review code with GitHub Copilot

A practical approach to AI code review: request a pull request review, evaluate Copilot’s comments and avoid overlooking important issues.

A person reviewing code fragments with a stylus on translucent screens

AI can quickly draw attention to suspicious code, but the team still decides what to change. Let’s organise code review with GitHub Copilot so comments help instead of creating a false sense of security.

1. Prepare a clear pull request

Start with a small, clearly defined change. In the pull request description, explain the problem, expected behaviour, important constraints and how you checked the result. For a complex change, identify files or scenarios that need special attention.

Do not add tokens, passwords or private data to the repository for demonstration. Before the review, check the changed files and make sure automated tests are available to the team.

2. Request a Copilot review

Open a new or existing pull request on GitHub. In Reviewers on the right, find Copilot and click Request. Wait for its comments and review them in the context of the changes. This is the flow described in GitHub’s documentation.

Availability depends on your subscription and organisation policies. For a team repository, an administrator may need to enable the feature. GitHub also supports automated reviews through user settings or repository rules.

3. Evaluate each comment

Copilot may suggest a ready-made change. First read not only the comment but also the surrounding code: which condition it analyses, what data arrives and what happens on error. Then compare the suggestion with the requirements and existing tests.

  • Can you reproduce the issue mentioned in the comment?
  • Does the proposed fix change public behaviour or the API contract?
  • Is a test needed for an edge case, access permissions or a repeated action?
  • Could the change cause a side effect elsewhere?

If a comment is incorrect or unrelated to the task, there is no need to accept it automatically. Record the reasoning in the discussion so other team members understand the context.

4. Add human review and tests

GitHub explicitly notes that Copilot can miss problems or make mistakes. After AI review, run the relevant tests and ask a person to review the logic, especially for authorisation, payments, data migrations and other sensitive areas.

Check the tool’s limits too: according to GitHub’s description, some file types, including SVG and dependency management files, are excluded from Copilot code review. The team needs to review them separately.

5. Review again after significant changes

If you rewrote important logic or added commits after the first review, consider whether another review is needed. GitHub’s documentation says that, without review-on-every-push enabled, you can request another review manually from the Reviewers menu.

Also consider costs: automatic reviews and different effort levels may use AI credits. Available settings and terms depend on the plan and organisation policies.

💬 Verdict: the most useful AI review result is a specific suggestion you can verify. Final decisions, tests and responsibility remain with the team. GitHub has also announced replacements for some Copilot models. Do you already use AI to review your pull requests?

SOURCES

  1. GitHub Docs — Using GitHub Copilot code review
  2. GitHub Docs — GitHub Copilot code review
← ALL ARTICLES