Skip to main content

Configuring runners for GitHub Copilot code review

Learn how to configure self-hosted runners or upgrade to larger GitHub-hosted runners for Copilot代码审查.

About GitHub Actions usage for code review tools

Copilot代码审查 利用 GitHub Actions 运行 Copilot代码评审中的工具,涵盖完整的项目上下文收集,并包括 数据变量.release-phases.public_preview %} 中的附加工具。 默认情况下,Copilot代码审查 使用 GitHub 托管的运行程序。

如果你的组织已禁用 GitHub托管运行器,那么新的 Copilot代码评审中的工具 将无法使用。 在这种情况下,代码评审将退化到更有限的评审。 Organizations in this situation can use self-hosted runners.

You can also upgrade to larger GitHub-hosted runners for better performance.

Configuring self-hosted runners for code review

You can run Copilot代码审查 using self-hosted GitHub Actions runners with ARC (Actions Runner Controller). You must first set up ARC-managed scale sets in your environment. For more information on ARC, see Actions Runner Controller.

警告

ARC is the only officially supported solution for self-hosting Copilot代码审查. For security reasons, we do not recommend using non-ARC self-hosted runners.

注意

Copilot代码审查 is only compatible with Ubuntu x64 Linux runners. Runners with Windows, macOS or other operating systems are not supported.

To configure self-hosted runners for Copilot代码审查:

  1. Configure network security controls for your GitHub Actions runners to ensure that Copilot代码审查 does not have open access to your network or the public internet.

    You must configure your firewall to allow connections to the standard hosts required for GitHub Actions self-hosted runners, plus the following hosts:

    • api.githubcopilot.com
    • uploads.github.com
    • user-images.githubusercontent.com
  2. In your copilot-setup-steps.yml file, set the runs-on attribute to your ARC-managed scale set name. For more information, see 自定义 GitHub Copilot 编码代理的开发环境.

    # ...
    
    jobs:
      copilot-setup-steps:
        runs-on: arc-scale-set-name
        # ...
    

Upgrading to larger GitHub-hosted GitHub Actions runners

By default, Copilot代码审查 works in a standard GitHub Actions runner. You can upgrade to larger runners for better performance (CPU and memory), more disk space, and advanced features like Azure private networking. For more information, see 大型运行程序.

注意

Usage of larger GitHub-hosted runners is billed per-minute and may incur additional GitHub Actions charges.

  1. Set up larger runners for your organization. For more information, see 管理较大的运行器.

  2. If you are using larger runners with Azure private networking, configure your Azure private network to allow outbound access to the following hosts:

    • api.githubcopilot.com
    • uploads.github.com
    • user-images.githubusercontent.com
  3. In your copilot-setup-steps.yml file, set the runs-on attribute to the label for the larger runners you want Copilot代码审查 to use. For more information on specifying larger runners with runs-on, see 在较大的运行器上运行作业.

    # ...
    
    jobs:
      copilot-setup-steps:
        runs-on: ubuntu-4-core
        # ...