自托管运行器连接到 GitHub 以接收作业分配并下载新版本的运行器应用程序。 自托管运行器使用 HTTPS long poll 打开 GitHub 连接 50 秒,如果没有收到任何响应,就会暂停并创建新的长轮询。 应用程序必须在机器上运行才能接受和运行 GitHub Actions 作业。
GitHub Actions 运行器应用程序是开源的。 可以参与 runner 存储库并在其中提交问题。 当发布新版本时,运行器应用程序在作业分配到运行器时或发布后一周内(如果运行器没有被分配任何作业)会自动更新。
自托管运行器与 GitHub Actions 未连接超过 14 天,将被自动从 GitHub 中删除。 临时自托管运行器与 GitHub Actions 未连接超过 1 天,将被自动从 GitHub 中删除。
自托管运行器和 GitHub 通过 HTTPS(端口 443)建立连接。
由于自托管运行器会打开与 GitHub 的连接,因此无需允许 GitHub 与自托管运行器建立入站连接。
必须确保机器具有适当的网络访问权限,且上传和下载速度至少达到 70 千位每秒,才可与以下列出的 GitHub 主机通信。 某些主机是基本运行器操作所必需的,而其他主机仅针对某些功能是必需的。
可以使用 REST API 获取关于 GitHub 的元信息,包括 GitHub 服务的 IP 地址和域详细信息。 API 的 actions_inbound
部分支持完全限定的域和通配符域。 完全限定的域指定完整的域名(例如 example.github.com
),而通配符域则使用 *
来表示多个可能的子域(例如 *.github.com
)。 下面列出了使用通配符域的自托管运行器要求的示例。 有关详细信息,请参阅“元数据的 REST API 终结点”。
github.com *.github.com *.githubusercontent.com ghcr.io
github.com
*.github.com
*.githubusercontent.com
ghcr.io
注意
列出的一些域名使用 CNAME
记录配置。 一些防火墙可能要求你为所有 CNAME
记录递归添加规则。 请注意,CNAME
记录将来可能会改变,只有列出的域名将保持不变。
基本操作所需:
github.com api.github.com *.actions.githubusercontent.com
github.com
api.github.com
*.actions.githubusercontent.com
下载操作时需要:
codeload.github.com pkg.actions.githubusercontent.com
codeload.github.com
pkg.actions.githubusercontent.com
发布不可变操作所需:
ghcr.io
ghcr.io
上传/下载作业摘要、工作流项目和缓存时需要:
results-receiver.actions.githubusercontent.com *.blob.core.windows.net
results-receiver.actions.githubusercontent.com
*.blob.core.windows.net
运行器版本更新需要:
objects.githubusercontent.com objects-origin.githubusercontent.com github-releases.githubusercontent.com github-registry-files.githubusercontent.com
objects.githubusercontent.com
objects-origin.githubusercontent.com
github-releases.githubusercontent.com
github-registry-files.githubusercontent.com
检索 OIDC 令牌时需要:
*.actions.githubusercontent.com
*.actions.githubusercontent.com
需要将包或容器下载或发布到 GitHub 包:
*.pkg.github.com pkg-containers.githubusercontent.com ghcr.io
*.pkg.github.com
pkg-containers.githubusercontent.com
ghcr.io
Needed for Git Large File Storage 需要
github-cloud.githubusercontent.com github-cloud.s3.amazonaws.com
github-cloud.githubusercontent.com
github-cloud.s3.amazonaws.com
Dependabot updates 的作业需要
dependabot-actions.githubapp.com
dependabot-actions.githubapp.com
此外,你的工作流程可能需要访问其他网络资源。
如果你对 GitHub 组织或企业帐户使用 IP 地址允许列表,必须将自托管运行器的 IP 地址添加到允许列表。 请参阅 GitHub Enterprise Cloud 文档中的管理组织允许的 IP 地址或在企业中实施安全设置策略。