Skip to main content

GitHub-hosted runners reference

Find information about GitHub-hosted runners, including their specifications and customization options.

Supported runners and hardware resources

Ranges of GitHub-hosted runners are available for use in public and private repositories.

For lists of available runners, see:

GitHub-hosted Linux runners support hardware acceleration for Android SDK tools, which makes running Android tests much faster and consumes fewer minutes. For more information on Android hardware acceleration, see Configure hardware acceleration for the Android Emulator in the Android Developers documentation.

注意

The -latest runner images are the latest stable images that GitHub provides, and might not be the most recent version of the operating system available from the operating system vendor.

警告

Beta and Deprecated Images are provided "as-is", "with all faults" and "as available" and are excluded from the service level agreement and warranty. Beta Images may not be covered by customer support.

用于公共存储库的 GitHub 托管的标准运行器

对于公共存储库,使用下表所示工作流标签的作业可在具有关联规范的虚拟机上运行。 可以在公共存储库上免费且无限制地使用这些运行器。

虚拟机 处理器 (CPU) 内存 (RAM) 存储 (SSD) 体系结构 工作流标签
Linux 4 16 GB 14 GB X64 ubuntu-latest, ubuntu-24.04, ubuntu-22.04
Windows 4 16 GB 14 GB x64 windows-latestwindows-2025windows-2022windows-2019
Linux [公共预览版] 4 16 GB 14 GB arm64 ubuntu-24.04-arm, ubuntu-22.04-arm
Windows [公共预览版] 4 16 GB 14 GB arm64 windows-11-arm
macOS 4 14 GB 14 GB Intel macos-13
macOS 3 (M1) 7 GB 14 GB arm64 macos-latest, macos-14, macos-15

注意

arm64 Linux 和 Windows 运行程序处于 公共预览版 阶段,可能会有所更改。

适用于专用存储库的标准 GitHub 托管的运行器

对于专用存储库,使用下表所示工作流标签的工作可在具有关联规范的虚拟机上运行。 这些运行程序使用 GitHub 帐户分配的免费分钟数,然后按每分钟费率收费。 有关详细信息,请参阅“关于 GitHub Actions 的计费”。

虚拟机 处理器 (CPU) 内存 (RAM) 存储 (SSD) 体系结构 工作流标签
Linux 2 7 GB 14 GB X64 ubuntu-latest, ubuntu-24.04, ubuntu-22.04
Windows 2 7 GB 14 GB x64 windows-latestwindows-2025windows-2022windows-2019
macOS 4 14 GB 14 GB Intel macos-13
macOS 3 (M1) 7 GB 14 GB arm64 macos-latest, macos-14, macos-15

Workflow logs list the runner used to run a job. For more information, see 查看工作流程运行历史记录.

Limitations for arm64 macOS runners

  • GitHub 提供的所有操作均与 arm64 GitHub 托管运行器兼容。 但是,社区操作可能与 arm64 不兼容,需要在运行时手动安装。
  • 由于 Apple 虚拟化框架的限制,不支持嵌套虚拟化和金属性能着色器 (MPS)。
  • Azure 专用网络和分配静态 IP 等网络功能目前不适用于 macOS 大型运行器。
  • 没有为 arm64 macOS 运行程序分配静态 UUID/UDID,因为 Apple 不支持此功能。 但是,为 Intel MacOS 运行程序分配了静态 UDID,具体为 4203018E-580F-C1B5-9525-B745CECA79EB。 如果要在计划测试生成的同一 主机上进行生成和签名,则可以使用开发预配配置文件进行签名。 如果需要静态 UDID,可以使用 Intel 运行程序并将其 UDID 添加到 Apple 开发者帐户。

大型运行器s

GitHub Team 和 GitHub Enterprise Cloud 计划的客户可以从一系列托管的虚拟机中选择,这些虚拟机比标准 GitHub 托管的运行器拥有更多资源。 这些计算机称为“大型运行器”。 具有以下高级功能:

  • 更多内存、CPU 和磁盘空间
  • 静态 IP 地址
  • Azure 专用网络
  • 分组运行器的能力
  • 自动缩放以支持并发工作流
  • GPU 支持的运行程序

这些 大型运行器 由 GitHub 托管,并预安装了运行器应用程序和其他工具。

For more information, see 使用较大运行器.

Administrative privileges

The Linux and macOS virtual machines both run using passwordless sudo. When you need to execute commands or install tools that require more privileges than the current user, you can use sudo without needing to provide a password. For more information, see the Sudo Manual.

Windows virtual machines are configured to run as administrators with User Account Control (UAC) disabled. For more information, see How User Account Control works in the Windows documentation.

IP addresses

To get a list of IP address ranges that GitHub Actions uses for GitHub-hosted runners, you can use the GitHub REST API. For more information, see the actions key in the response of the GET /meta endpoint. For more information, see 元数据的 REST API 终结点.

Windows and Ubuntu runners are hosted in Azure and subsequently have the same IP address ranges as the Azure datacenters. macOS runners are hosted in GitHub's own macOS cloud.

Since there are so many IP address ranges for GitHub-hosted runners, we do not recommend that you use these as allowlists for your internal resources. Instead, we recommend you use 大型运行器s with a static IP address range, or self-hosted runners. For more information, see 使用较大运行器 or 关于自托管运行程序.

The list of GitHub Actions IP addresses returned by the API is updated once a week.

Communication requirements for GitHub-hosted runners

A GitHub-hosted runner must establish connections to GitHub-owned endpoints to perform essential communication operations. In addition, your runner may require access to additional networks that you specify or utilize within an action.

To ensure proper communications for GitHub-hosted runners between networks within your configuration, ensure that the following communications are allowed.

注意

列出的一些域名使用 CNAME 记录配置。 一些防火墙可能要求你为所有 CNAME 记录递归添加规则。 请注意,CNAME 记录将来可能会改变,只有列出的域名将保持不变。

基本操作所需:

Shell
github.com
api.github.com
*.actions.githubusercontent.com

下载操作时需要:

Shell
codeload.github.com
pkg.actions.githubusercontent.com

发布不可变操作所需:

Shell
ghcr.io

上传/下载作业摘要、工作流项目和缓存时需要:

Shell
results-receiver.actions.githubusercontent.com
*.blob.core.windows.net

运行器版本更新需要:

Shell
objects.githubusercontent.com
objects-origin.githubusercontent.com
github-releases.githubusercontent.com
github-registry-files.githubusercontent.com

检索 OIDC 令牌时需要:

Shell
*.actions.githubusercontent.com

需要将包或容器下载或发布到 GitHub 包:

Shell
*.pkg.github.com
pkg-containers.githubusercontent.com
ghcr.io

Needed for Git Large File Storage 需要

Shell
github-cloud.githubusercontent.com
github-cloud.s3.amazonaws.com

Dependabot updates 的作业需要

Shell
dependabot-actions.githubapp.com

File systems

GitHub executes actions and shell commands in specific directories on the virtual machine. The file paths on virtual machines are not static. Use the environment variables GitHub provides to construct file paths for the home, workspace, and workflow directories.

DirectoryEnvironment variableDescription
homeHOMEContains user-related data. For example, this directory could contain credentials from a login attempt.
workspaceGITHUB_WORKSPACEActions and shell commands execute in this directory. An action can modify the contents of this directory, which subsequent actions can access.
workflow/event.jsonGITHUB_EVENT_PATHThe POST payload of the webhook event that triggered the workflow. GitHub rewrites this each time an action executes to isolate file content between actions.

For a list of the environment variables GitHub creates for each workflow, see 在变量中存储信息.

Docker container filesystem

Actions that run in Docker containers have static directories under the /github path. However, we strongly recommend using the default environment variables to construct file paths in Docker containers.

GitHub reserves the /github path prefix and creates three directories for actions.

  • /github/home
  • /github/workspace - 注意: GitHub Actions 必须由默认 Docker 用户 (root) 运行。 确保 Dockerfile 没有设置 USER 指令,否则你将无法访问 GITHUB_WORKSPACE
  • /github/workflow