# Configuring code review by GitHub Copilot

> Set up Copilot to review pull requests.

- 网址：https://funcoding.ai/agents/github-copilot/how-tos/copilot-on-github/set-up-copilot/configure-code-review/
- 来源：GitHub Copilot 官方文档原文（英文），CC-BY-4.0 许可，同步于 2026-10-11
- 官方原文：https://docs.github.com/en/copilot/how-tos/copilot-on-github/set-up-copilot/configure-code-review

---
## Introduction

You can configure Copilot code review to review pull requests automatically, set your Copilot review effort, and control who can request reviews. For an overview, see [AUTOTITLE](https://funcoding.ai/agents/github-copilot/concepts/agents/code-review/#automatic-pull-request-reviews).

## Configuring automatic code review for your own pull requests

You can set Copilot code review to review the pull requests you create, in any repository where Copilot code review is available to you.

<div class="callout callout-note">

Configuring automatic code review is available on the Copilot Pro, Copilot Pro+, and Copilot Max plans, and with a Copilot Business or Copilot Enterprise license. It is not available for managed user accounts.

</div>

1. In the upper-right corner of any page on GitHub, click your profile picture, then click **copilot Copilot settings**.
1. In the sidebar, under **copilot Copilot**, click **Code review**.
1. Enable **Automatic Copilot code review**.
1. Optionally, to review each new push to a pull request that Copilot is already reviewing, enable **Review new pushes**.
1. Optionally, to review pull requests while they are still marked as drafts, enable **Review draft pull requests**.

A pull request can qualify for automatic review from several independent sources: your user settings, repository rulesets, or organization rulesets. These sources are evaluated separately. If more than one source applies, Copilot still posts a single review. Your user settings cannot disable push or draft reviews that a ruleset has enabled. For more information, see [AUTOTITLE](https://funcoding.ai/agents/github-copilot/concepts/agents/code-review/#automatic-pull-request-reviews).

## Configuring your Copilot review effort

You can choose the Copilot review effort that Copilot code review uses for the reviews you request. Your choice applies to automatic reviews and to reviews you request manually. For an overview of the levels and how Copilot decides which to use, see [AUTOTITLE](https://funcoding.ai/agents/github-copilot/concepts/agents/code-review/#review-effort-level).

1. In the upper-right corner of any page on GitHub, click your profile picture, then click **copilot Copilot settings**.
1. In the sidebar, under **copilot Copilot**, click **Code review**.
1. Next to "Review effort level," select the Copilot review effort for reviews you request.
   * **Lite**: Standard review.
   * **Balanced**: Deeper analysis of complex logic, security-sensitive code, and cross-service changes.
   * **Max**: Most thorough review. This option appears with a **Coming soon** label and is not available yet.

To return to the built-in default, select the **Default** option at the top of the menu. Until you choose a specific level, the control shows the built-in default, **Default (Balanced)**.

Your Copilot review effort is independent of **Automatic Copilot code review**. Turning automatic review off does not clear your Copilot review effort or stop it from applying to reviews you request manually.

## Configuring automatic code review for a repository

You can enable automatic code reviews for a repository and customize how code reviews are performed.

### Enabling automatic reviews

1. On GitHub, navigate to the main page of the repository.
1. Under your repository name, click **gear Settings**. If you cannot see the "Settings" tab, select the **More** dropdown menu, then click **Settings**.

   ![Screenshot of a repository header showing the tabs. The "Settings" tab is highlighted by a dark orange outline.](https://funcoding.ai/official-assets/github-copilot/assets/images/help/repository/repo-actions-settings.webp)
1. In the left sidebar, under "Code, planning, and automation", click **Rulesets**, then click **Rulesets**.
1. Click **New ruleset**.
1. Click **New branch ruleset**.
1. Under "Ruleset name," type a name for the ruleset.
1. To activate the ruleset, under "Enforcement Status", select **Active**.
1. Under "Target branches," click **Add target** and choose one of the options—for example, **Include default branch** or **Include all branches**.
1. Under "Target branches," click **Add target** and choose one of the target options.
1. Under "Branch rules," select **Automatically request Copilot code review**.

1. Optionally, if you want Copilot to review all new pushes to the pull request, select **Review new pushes**.

   If this option is not selected, Copilot will only review the pull request once.

1. Optionally, if you want Copilot to review pull requests while they are still drafts, select the **Review draft pull requests**.

   This can be a useful option for catching errors early, before requesting a human review.

1. At the bottom of the page, click **Create**.

### Customizing Copilot code review

You can configure how Copilot code review completes code reviews in your repository.

1. On GitHub, navigate to the main page of the repository.
1. Under your repository name, click **gear Settings**. If you cannot see the "Settings" tab, select the **More** dropdown menu, then click **Settings**.

   ![Screenshot of a repository header showing the tabs. The "Settings" tab is highlighted by a dark orange outline.](https://funcoding.ai/official-assets/github-copilot/assets/images/help/repository/repo-actions-settings.webp)
1. In the sidebar, under "Code, planning, and automation", click **copilot Copilot**, then **Code review**.
1. To choose the depth of Copilot code reviews, next to "Review effort level," select the effort level for automatic reviews in this repository.
   * **Lite**: Standard review.
   * **Balanced**: Deeper analysis of complex logic, security-sensitive code, and cross-service changes.

   Balanced reviews use more AI credits, and may consume marginally more GitHub Actions minutes. See [AUTOTITLE](https://funcoding.ai/agents/github-copilot/concepts/agents/code-review/#estimated-consumption).
1. To choose whether Copilot can approve pull requests in your repository, configure the settings under "Auto-approval."
   * **Allow Copilot to approve pull requests**: Toggle on to let Copilot submit approving reviews.
   * **Allow Copilot approvals to count toward merge requirements**: Toggle on so Copilot approvals can satisfy pull request approval requirements.
   * **File paths**: Optionally, limit which pull requests count toward merge requirements. Enter one file glob per line to count approvals only on pull requests where every changed file matches one of the globs. Leave blank to count approvals for all files. Up to 15 globs are supported.

<div class="callout callout-note">

Copilot approvals are in public preview and subject to change.

</div>

1. To prevent people from using an external Copilot license to request reviews in this repository, enable **Only allow Copilot code review to be triggered by authorized users**. If this setting is enabled for your organization, you cannot turn it off for the repository. See [AUTOTITLE](https://funcoding.ai/agents/github-copilot/concepts/agents/code-review/#reviews-requested-with-an-external-copilot-license).

## Configuring automatic code review for repositories in an organization

You can enable automatic code reviews for repositories in your organization and customize how code reviews are performed.

### Enabling automatic reviews

1. In the upper-right corner of GitHub, click your profile picture, then click **organization Organizations**.
1. Select an organization by clicking on it.
1. Under your organization name, click **gear Settings**. If you cannot see the "Settings" tab, select the **More** dropdown menu, then click **Settings**.

   ![Screenshot of the tabs in an organization's profile. The "Settings" tab is outlined in dark orange.](https://funcoding.ai/official-assets/github-copilot/assets/images/help/discussions/org-settings-global-nav-update.webp)
1. In the sidebar, under "Code, planning, and automation", click **repo Repository**, then click **Rulesets**.
1. Click **New ruleset**.
1. Click **New branch ruleset**.
1. Under "Ruleset name," type a name for the ruleset.
1. To activate the ruleset, under "Enforcement Status", select **Active**.
1. Under "Target repositories," click **Add target** and choose either **Include by pattern** or **Exclude by pattern**.
1. Type a pattern that matches the repository names you want to target—for example, `*feature` to match all repositories with names ending in `feature`.

   For pattern-matching syntax, see [AUTOTITLE](https://docs.github.com/organizations/managing-organization-settings/creating-rulesets-for-repositories-in-your-organization#using-fnmatch-syntax).

1. Click **Add inclusion pattern** or **Add exclusion pattern**.
1. Repeat for any additional patterns.

<div class="callout callout-note">

You can add multiple targeting criteria to the same ruleset. Exclusion patterns are applied after inclusion patterns. For example, you could include any repositories matching the pattern `*cat*`, and specifically exclude a repository matching the pattern `not-a-cat`.

</div>

1. Under "Target branches," click **Add target** and choose one of the target options.
1. Under "Branch rules," select **Automatically request Copilot code review**.

1. Optionally, if you want Copilot to review all new pushes to the pull request, select **Review new pushes**.

   If this option is not selected, Copilot will only review the pull request once.

1. Optionally, if you want Copilot to review pull requests while they are still drafts, select the **Review draft pull requests**.

   This can be a useful option for catching errors early, before requesting a human review.

1. At the bottom of the page, click **Create**.

### Customizing Copilot code review

You can configure how Copilot code review completes code reviews in repositories in your organization.

1. In the upper-right corner of GitHub, click your profile picture, then click **organization Organizations**.
1. Select an organization by clicking on it.
1. Under your organization name, click **gear Settings**. If you cannot see the "Settings" tab, select the **More** dropdown menu, then click **Settings**.

   ![Screenshot of the tabs in an organization's profile. The "Settings" tab is outlined in dark orange.](https://funcoding.ai/official-assets/github-copilot/assets/images/help/discussions/org-settings-global-nav-update.webp)
1. In the sidebar, under "Code, planning, and automation", click **copilot Copilot**, then **Code review**.
1. To choose the depth of Copilot code reviews, next to "Review effort level," select the default effort level for automatic reviews in repositories in your organization.
   * **Lite**: Standard review.
   * **Balanced**: Deeper analysis of complex logic, security-sensitive code, and cross-service changes.

    Balanced reviews use more AI credits, and may consume marginally more GitHub Actions minutes. See [AUTOTITLE](https://funcoding.ai/agents/github-copilot/concepts/agents/code-review/#estimated-consumption).
1. To choose how AI credits usage associated with members who have paid Copilot licenses is billed, next to **Choose how members with a Copilot license are billed**, select an option.
   * **Member**: Use the member's Copilot entitlement. If the member's quota is exhausted, the code review fails. This is the default.
   * **Organization**: Bill the organization.

   This choice applies to both manually requested and automatic code reviews, and changes billing only. It does not grant access to Copilot code review. To use **Organization**, AI credits paid usage must be enabled for the organization. Setting a budget is optional. See [AUTOTITLE](https://docs.github.com/copilot/concepts/billing/organizations-and-enterprises/usage-based-billing#what-happens-if-i-exceed-my-included-ai-credits).
1. To choose whether Copilot can approve pull requests in your repositories, select an option under "Approvals," next to "Count Copilot approvals toward merge requirements."
   * **Enabled everywhere**: Copilot approvals can count toward merge requirements in every repository in the organization.
   * **Let repositories decide**: Repository admins can decide this in repository settings.
   * **Enable for selected repositories**: Copilot approvals can count toward merge requirements only in the repositories you select. If you choose this option, also assign the repositories you want to enable this for.
   * **Disabled everywhere**: Copilot approvals cannot count toward merge requirements in any repository in the organization.
   

<div class="callout callout-note">

Copilot approvals are in public preview and subject to change.

</div>

1. To prevent people from using an external Copilot license to request reviews in your organization's repositories, enable **Only allow Copilot code review to be triggered by authorized users**. This setting applies to every repository in the organization, and repository administrators cannot turn it off.

## Configuring automatic code review for an enterprise

You can enable automatic code reviews for your enterprise and customize how code reviews are performed.

### Enabling automatic reviews

1. Create an enterprise-level branch ruleset. See [AUTOTITLE](https://docs.github.com/enterprise-cloud@latest/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-code-governance).
1. Target the organizations and repositories where Copilot code review should run automatically.
1. Enable the **Automatically request Copilot code review** policy.
1. Optionally, enable automatic reviews for draft pull requests and after each push to a pull request.
1. Click **Create**.

### Customizing Copilot code review

You can configure how Copilot code review completes code reviews for your enterprise.

1. Navigate to your enterprise. For example, from the [Enterprises](https://github.com/settings/enterprises?ref_product=ghec&ref_type=engagement&ref_style=text) page on GitHub.com.

1. At the top of the page, click **copilot AI controls**.
1. Scroll down to "Available Agents", then click **Copilot code review**.
1. Next to "Copilot code review", select a policy.
1. Then choose which Copilot code review features to enable for your enterprise.
1. To choose who is billed for Copilot code review usage by members with a paid Copilot license, next to "Choose how members with a Copilot license are billed," select a policy.
   * **Member**: Use the member's Copilot entitlement for organizations in the enterprise.
   * **Organization**: Bill the organization that owns the repository.
   * **Let organizations decide**: Organization owners can choose how to bill usage associated with members who have paid Copilot licenses.

   Organizations billed must have AI credits paid usage enabled. Setting a budget is optional.
1. To choose whether Copilot can approve pull requests in your organizations, next to "Allow Copilot to approve pull requests," select a policy.
   * **Let organizations decide**: Organization owners can choose whether to enable Copilot approvals.
   * **Enable for selected organizations**: Copilot approvals are enabled only for the organizations you select.
   * **Disabled everywhere**: Organizations cannot enable Copilot approvals. This is the default.

<div class="callout callout-note">

Copilot approvals are in public preview and subject to change.

</div>
