Skip to main content

为 GitHub Copilot 代码评审配置自托管运行器

了解如何为 Copilot 代码评审 配置自托管运行器。

About GitHub Actions usage for code review tools

Copilot code review uses GitHub Actions to run the tools in Copilot code review, including full project context gathering and the additional tools in public preview. By default, Copilot code review uses GitHub-hosted runners.

If your organization has disabled GitHub-hosted runners, the new tools in Copilot code review will not be available. In this case, code reviews will fall back to a more limited review. Organizations in this situation can use self-hosted runners.

Configuring self-hosted runners for code review

You can run Copilot code review 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 code review. For security reasons, we do not recommend using non-ARC self-hosted runners.

注意

Copilot code review 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 code review:

  1. Configure network security controls for your GitHub Actions runners to ensure that Copilot code review 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 Customizing the development environment for GitHub Copilot coding agent.

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