关于代码审查工具的 GitHub Actions 使用情况
Copilot 代码审查使用 GitHub Actions 来运行代理功能,包括完整的项目上下文收集以及任何公开预览的功能。默认情况下,Copilot 代码审查使用 GitHub 托管的运行器。
如果你的组织已禁用 GitHub 托管的运行器,则代理功能将不可用。在这种情况下,代码审查将回退为功能更受限的审查。此情形下的组织可以使用自托管运行器。
你也可以升级到更大的 GitHub 托管运行器,以获得更好的性能。
为代码审查配置自托管运行器
使用 ARC(Actions Runner Controller)通过自托管的 GitHub Actions 运行器运行 Copilot 代码审查。你必须首先在你的环境中设置 ARC 管理的规模集。有关 ARC 的更多信息,请参阅 Actions Runner Controller。
警告
ARC 是唯一官方支持的自托管 Copilot 代码审查解决方案。出于安全考虑,请勿使用非 ARC 的自托管运行器。
Copilot 代码审查仅兼容 Ubuntu x64 Linux 运行器。
配置 Copilot 代码审查的自托管运行器
-
为你的 GitHub Actions 运行器配置网络安全控制,以确保 Copilot 代码审查不会对你的网络或公共互联网拥有开放访问权限。
你必须配置防火墙以允许连接到 GitHub Actions 自托管运行器所需的标准主机,以及以下主机
api.githubcopilot.comuploads.github.comuser-images.githubusercontent.com
-
在你的
copilot-setup-steps.yml文件中,将runs-on属性设置为你的 ARC 管理的规模集名称。欲了解更多信息,请参阅 Customizing the development environment for GitHub Copilot cloud agent。# ... jobs: copilot-setup-steps: runs-on: arc-scale-set-name # ...
升级到更大的 GitHub 托管 GitHub Actions 运行器
默认情况下,Copilot 代码审查在标准的 GitHub Actions 运行器上运行。更大的运行器提供更好的性能(CPU 和内存),更多的磁盘空间,以及诸如 Azure 私有网络等高级功能。参见 Larger runners。
注意
使用更大的 GitHub 托管运行器按分钟计费,可能会产生额外的 GitHub Actions 费用。
-
为你的组织设置更大的运行器。参见 Managing larger runners。
-
如果你使用带有 Azure 私有网络的更大运行器,请配置你的 Azure 私有网络以允许对以下主机的出站访问
api.githubcopilot.comuploads.github.comuser-images.githubusercontent.com
-
在你的
copilot-setup-steps.yml文件中,将runs-on属性设置为你希望 Copilot 代码审查使用的更大运行器的标签。参见 Running jobs on larger runners。# ... jobs: copilot-setup-steps: runs-on: ubuntu-4-core # ...