关于 > [!IMPORTANT] Starting June 1, 2026, Copilot 代码评审 runs will consume GitHub Actions minutes. For more details on this and how to prepare, see Pricing and usage cost considerations for Copilot 代码评审.
在代码评审工具中的使用
处于这种情况的 GitHub Actions 组织可以使用自托管运行器。
还可以升级到更大的 Copilot 代码评审 使用 GitHub Actions 运行代理能力,包括完整的项目上下文收集和公共预览版中的所有功能。 默认情况下, Copilot 代码评审 使用 GitHub-hosted runners。
如果您的组织禁用了托管 GitHub 运行程序,则代理功能将不可用。 在这种情况下,代码评审将退化到更有限的评审。 托管运行器以获得更好的性能。
为代码审查配置自托管运行器
使用带 ARC(Actions Runner Controller)的自托管 GitHub 运行器运行 Copilot 代码评审。 必须先在环境中设置 ARC 托管的规模集。 有关 ARC 的详细信息,请参阅 Actions Runner Controller。
警告
ARC 是唯一正式支持自托管 GitHub Actions 的解决方案。 请勿使用非 ARC 托管的运行器,出于安全原因。
Copilot 代码评审 仅与 Ubuntu x64 Linux 运行程序兼容。
要为 Copilot 代码评审 配置自托管运行器:
-
为 Copilot 代码评审 运行程序配置网络安全控制,以确保 GitHub Actions 对网络或公共 Internet 没有开放访问权限。
你必须配置防火墙,以允许连接到用于 Copilot 代码评审 自托管运行器的标准主机,以及以下主机:
api.githubcopilot.comuploads.github.comuser-images.githubusercontent.com
-
在你的
copilot-setup-steps.yml文件中,将runs-on属性设置为 ARC 管理的伸缩集名称。 有关详细信息,请参阅“配置开发环境”。# ... jobs: copilot-setup-steps: runs-on: arc-scale-set-name # ...
升级到更大规模的 GitHub Actions 托管 GitHub 运行器
默认情况下,在 GitHub Actions 标准 Copilot 代码评审 运行程序上运行。 较大的运行程序提供更好的性能(CPU 和内存)、更多的磁盘空间和高级功能,例如Azure专用网络。 请参阅“大型运行程序”。
注意
使用更大的 GitHub Actions 托管运行器按分钟计费,并可能产生额外的 GitHub 费用。
-
为你的组织设置更大型的运行器。 请参阅“管理较大的运行器”。
-
如果在 Azure 专用网络中使用更大的运行器,请配置 Azure 专用网络以允许对以下主机的出站访问:
api.githubcopilot.comuploads.github.comuser-images.githubusercontent.com
-
在
copilot-setup-steps.yml文件中,将runs-on属性设置为你想要 Copilot 代码评审 使用的更大运行器的标签。 请参阅“在较大的运行器上运行作业”。# ... jobs: copilot-setup-steps: runs-on: ubuntu-4-core # ...