Skip to main content
Skip to content

Enabling GitHub Copilot code review in your organization

Turn on Copilot code review for your organization's pull requests without assigning a Copilot license to any member.

谁可以使用此功能?

Organization owners

Copilot Business、Copilot Enterprise或适用于符合条件企业的 Copilot 访问计划

After you enable the policy for Copilot code review, members with a Copilot license from your organization can request reviews. You can also allow reviews without a license. The AI credits those reviews use are billed to your organization or enterprise.

Subscribing to Copilot Business without assigning licenses

Your organization needs a Copilot plan and a payment method and billing information on file, but it doesn't need to assign any licenses. If your organization already has a plan, skip to Enabling Copilot code review. If your organization is owned by an enterprise, an enterprise owner sets up the plan. See 为您的企业订阅GitHub Copilot.

  1. Navigate to the GitHub Copilot sign up page.
  2. Make sure you're signed in to the right organization account. If you aren't, click Switch and select the organization.
  3. Click Enable GitHub Copilot.

After you enable Copilot, you don't need to assign any licenses. You're billed for Copilot Business licenses only when you assign them.

Enabling Copilot code review

We recommend having your organization pay for every review, so that no pull request goes without a review. Otherwise, reviews for members who use their own Copilot license, such as Copilot Pro, stop when those members run out of AI credits, and pull requests from authors without a license don't get reviews. To limit what your organization spends, see Controlling spending.

If your organization is owned by an enterprise, you can't change settings that an enterprise owner has set. An enterprise owner can turn on reviews without a license or let organizations decide. See 为你的企业启用 GitHub Copilot 代码审查.

  1. 在 GitHub 的右上角,单击个人资料图片,然后单击“ Your organizations”****。

  2. 通过单击组织来选择组织。

  3. 在组织名称下,单击 “Settings”****。 如果看不到“设置”选项卡,请选择“”下拉菜单,然后单击“设置”********。

    组织配置文件中选项卡的屏幕截图。 “设置”选项卡以深橙色标出。

  4. 在边栏中的“代码、规划和自动化”下, click Copilot, then Policies.

  5. Under "Billing," next to "AI credit paid usage," select Enabled, or select Enabled for selected products and turn on Opt in to Copilot AI Credits paid usage.

  6. Next to "Copilot code review," select Enabled.

  7. Next to "Choose how members with a Copilot license are billed," select Organization.

  8. Turn on Allow reviews without a Copilot license. Reviews without a license include pull requests from outside contributors, members on Copilot Free, and bots such as Dependabot.

Pull requests in your organization can now get reviews from Copilot, whether or not their authors have a license. Members without a license can't request reviews in IDEs.

Configuring automatic code review

To have Copilot review pull requests without anyone requesting a review, create a ruleset for the repositories where you want automatic reviews. After members without a license can use Copilot code review, automatic reviews run on their pull requests too. See 通过GitHub Copilot配置代码评审.

Controlling spending

If your organization isn't owned by an enterprise and has no assigned licenses, or is owned by an enterprise on the Copilot access plan, it has no included AI credits. Every review billed to it is paid usage.

To cap spending, create an organization budget for AI credits and select Stop usage when budget limit is reached. At the limit, reviews that need paid usage stop until the next billing cycle or until you raise the budget. See 设置预算以控制按流量计费的产品的支出.

If your organization is owned by an enterprise, create the budget in your enterprise account's billing settings, with your organization as its scope. An enterprise owner can also set a budget for a cost center or the whole enterprise. See 基于使用情况的计费预算.

Reviews also use GitHub Actions minutes. See GitHub Copilot代码审核.