Skip to main content

Enabling GitHub Copilot code review in your enterprise

Apply consistent standards by having Copilot review every pull request.

谁可以使用此功能?

Enterprise owners

重要

从 2026 年 6 月 1 日起, Copilot 代码评审 运行将消耗 GitHub Actions 分钟数。 有关此信息以及如何进行准备工作的更多详细信息,请参阅 定价和使用成本注意事项 Copilot 代码评审

GitHub Copilot can review pull requests in your enterprise. This can save time for human reviewers by detecting bugs or vulnerabilities and enforcing consistent coding standards.

Enabling Copilot 代码评审 for your Copilot subscribers

The policy for Copilot 代码评审 allows your licensed users to request reviews from Copilot and use Copilot to generate pull request summaries.

  1. 导航到您的企业。 例如,从 GitHub.com 上的 公司 页面。
  2. 在页面顶部,单击 AI 控件
  3. Scroll down to "Available Agents", then click Copilot 代码评审.
  4. Next to "Copilot 代码评审", select a policy.

后续步骤

  • 如果选择 了“随处启用”,请告知组织所有者为所有成员启用这些功能。
  • 如果选择了 “让组织决定”,请与组织所有者讨论成员权限启用。

Configuring automatic code review

To apply standards consistently, you can configure Copilot 代码评审 to run automatically on all pull requests opened across your enterprise or in specific repositories.

  1. Create an enterprise-level branch ruleset. See 使用规则集在企业中强制实施代码治理.
  2. Target the organizations and repositories where Copilot 代码评审 should run automatically. You may want to start with a small selection of repositories and run a trial to collect feedback.
  3. Enable the Automatically request Copilot 代码评审 policy.
  4. Optionally, enable the additional settings. By reviewing on every push and reviewing draft pull requests, you will add consistency to the review process. However, you will also create more noise for developers. If you're running a pilot, consider starting with the basic setting to allow developers to get used to the new process first.
  5. Click Create.

Customizing reviews

Encourage organization and repository administrators to create custom instructions for Copilot 代码评审 so that reviews will be tailored to your coding standards and conventions. See 使用自定义指令来激发Copilot代码评审的强大功能.