选择运行器与 Windows 环境
配置 larger 或 self-hosted runners,并核对网络、代理和支持平台。
This page has not been translated into English yet. The original Chinese version is shown below.
默认环境是标准 GitHub-hosted runner 上的 Ubuntu Linux。需要更多 CPU、内存、磁盘或私有网络时,可以选择 larger runners;也可使用 self-hosted runners 访问内部资源。
支持平台和组织约束
cloud agent 支持 Ubuntu x64 Linux 与 Windows 64-bit runner,不支持 macOS 或其他操作系统 runner。
组织所有者可以统一配置默认 runner 类型,并决定仓库能否覆盖。仓库文件中的 runs-on 还需要满足组织设置,不能单凭更改 YAML 推定已经切换成功。
Larger runners
先由组织配置好 larger runner,再在setup 文件的 copilot-setup-steps job 中指定其 label 或 group。官方示例的 job 片段如下,实际 label 必须对应已配置的 runner:
jobs:
copilot-setup-steps:
runs-on: ubuntu-4-core如果使用 Azure private networking,应允许下面的 cloud agent 主机;具体套餐的 API 地址按实际使用者配置。
Self-hosted runners
官方建议使用临时、单次任务后销毁的 runner,避免多个任务复用同一执行环境。常见部署方式包括 Actions Runner Controller 或 Runner Scale Set Client。
- 为 runner 配置自己的网络控制,限制内部网络与公网访问。
- 允许 GitHub Actions 自托管 runner 所需标准域名,以及下表的 Copilot 额外主机。
- 在仓库设置中关闭集成防火墙:它不兼容 self-hosted runner,不关闭会阻止 cloud agent 使用。
- 将 job 的
runs-on设为实际配置的 scale set 名称,例如官方的arc-scale-set-name占位名。
关闭集成防火墙之前,先落实 runner 层的网络限制。两者不是可以同时依赖的同一套控制。
网络出口
| 主机 | 适用范围 |
|---|---|
uploads.github.com、user-images.githubusercontent.com | 云端代理所需上传和图片服务 |
api.individual.githubcopilot.com | Pro、Pro+、Max 使用者 |
api.business.githubcopilot.com | Business 使用者 |
api.enterprise.githubcopilot.com | Enterprise 使用者 |
若使用 OpenAI Codex 第三方 coding agent,官方还列出 npmjs.org、npmjs.com、registry.npmjs.com、registry.npmjs.org、skimdb.npmjs.com。这些是相应运行器说明中的补充地址,不能替代完整 GitHub Actions 主机清单。
代理环境变量
自托管环境专题列出的变量如下;名称按该专题原文保留,不将 IDE 代理变量的大小写和优先级移植到这里。
| 变量 | 用途 |
|---|---|
https_proxy | HTTPS 流量代理,如 http://proxy.local |
http_proxy | HTTP 流量代理 |
no_proxy | 逗号分隔的绕过代理主机或 IP |
ssl_cert_file | 代理拦截 TLS 时所用证书文件路径 |
node_extra_ca_certs | 该专题列出的 Node 额外证书路径变量 |
可以用 Agents secrets/variables,或在 runner 镜像等环境中设置。部分客户端只有请求直接使用 IP 时才匹配 no_proxy 中的 IP,不能把域名访问一定绕过代理作为前提。
Windows
集成防火墙也不兼容 Windows。官方建议在自托管 runner,或带 Azure private networking 的 larger GitHub-hosted runner 上运行 Windows,并自行控制网络。选择真实 Windows runner 的 label,不能只更改构建命令就得到 Windows 环境。
组织默认值与仓库覆盖
组织 Settings → Copilot → Cloud agent → Runner type 旁点击编辑。选择 Standard GitHub runner 使用 ubuntu-latest;选择 Labeled runner 时填写 Runner group name 和/或 Runner label,再点 Save runner selection。
Allow repositories to customize the runner type 默认开启,仓库可在 .github/workflows/copilot-setup-steps.yml 的 copilot-setup-steps job 中通过 runs-on 覆盖。关闭并保存后,所有组织仓库都采用组织配置;仓库YAML中仍存在另一值,并不代表它继续生效。