Skip to content

参考

基于 GitHub 官方文档 —— 产品矩阵 / Actions 字段全表 / Runner / Copilot 计费 / 计划对比 / 安全 / 迁移

GitHub 产品矩阵

产品定位典型用户
GitHub.com(SaaS)云端托管 + 全套协作个人、团队、开源
GitHub Enterprise Cloud云端企业版(多 org、合规)企业
GitHub Enterprise Server自托管(内网部署)强合规、内网企业
GitHub ActionsCI/CD所有
GitHub Packages制品仓库所有
GitHub Pages静态站托管文档、博客、项目主页
GitHub Codespaces云端 IDE(按计算分钟)远程开发
GitHub CopilotAI 编程助手所有
GitHub Marketplace第三方 Action/App 商店扩展生态

计划与免费额度(2026)

计划价格Actions 分钟/月Packages 存储备注
Free$02000(私有库)/ 无限(公开库)500MB无限私有库、无限协作者
Pro$4/月30001GB个人开发者增强
Team$4/user/月30002GB团队协作
Enterprise$21/user/月5000050GBSSO、审计、合规
  • 公开仓库的 Actions 永久免费、无分钟限制(这是开源项目零成本 CI 的基础)
  • Runner OS 倍率:Linux ×1、Windows ×2、macOS ×10(macOS 跑 1 分钟扣 10 分钟额度)
  • Codespaces:免费 120 核小时/月(2 核)、15GB 存储

GitHub Actions workflow 字段速查

顶层

字段说明
nameworkflow 名
on触发器
env全局环境变量
permissionsGITHUB_TOKEN 权限
concurrency并发控制(同分支只跑最新)
jobs任务集合

job 字段

字段说明
runs-onRunner(ubuntu-latest / self-hosted
needs依赖的 job
if条件
steps步骤列表
environment引用部署环境(用其 secrets)
strategymatrix 矩阵
timeout-minutes超时(默认 360)
continue-on-error失败是否继续
services附属容器(如 postgres/mysql)

step 字段

字段说明
name步骤名
uses调用 Action(actions/checkout@v4
with传给 Action 的参数
run跑 shell 命令
env环境变量
if条件
working-directory工作目录

触发器一览

触发器触发时机
push推代码
pull_requestPR 操作(opened/synchronize/closed)
schedule定时(cron,UTC)
workflow_dispatch手动(UI / API)
repository_dispatch外部 API
release发布 release
issue / issue_commentIssue 操作
workflow_call被其它 workflow 调用
page_buildPages 构建
watchStar

常用官方 Action

Action用途
actions/checkout@v4拉代码(默认不拉,必须显式)
actions/setup-node@v4装 Node
actions/setup-python@v5装 Python
actions/setup-java@v4装 Java
actions/cache@v4缓存依赖
actions/upload-artifact@v3上传构建产物
actions/download-artifact@v3下载产物
actions/upload-pages-artifact@v3打包 Pages 产物
actions/deploy-pages@v4部署 Pages
github/codeql-actionCodeQL 安全扫描

Runner 对照

RunnerOS倍率计费
ubuntu-latestLinux×1私有库扣额度
windows-latestWindows×2私有库扣额度
macos-latestmacOS×10私有库扣额度
self-hosted任意免费私有库也免费(自己出机器成本)

ubuntu-latest 当前指向 Ubuntu 24.04(随时间更新)。

Copilot 计费(2026-06-01 用量制)

计划月费含 AI Credits促销期额外
Pro$10/月$10-
Pro+$39/月$39-
Business$19/user/月$192026.06-08 月 +$30 促销
Enterprise$39/user/月$392026.06-08 月 +$70 促销
  • 计量单位:GitHub AI Credits(替代旧 Premium Request Units / PRUs)
  • 消耗依据:token 用量(输入/输出/缓存)× 各模型 API 费率
  • 不消耗 Credits:代码补全、Next Edit 建议
  • 消耗 Credits:Chat、Agent、Copilot Review(Review 还额外扣 Actions 分钟)
  • 超额:可买 Credits 或开启 overage 按发布费率计费
  • 管理:enterprise / cost center / user 三级 budget,可设上限或允许 overage
  • 池化:组织内未用 Credits 可跨用户共享
  • 迁移:月付用户 2026-06-01 自动迁移;年付用户到期前维持旧价(但模型倍率 06-01 同步调整)

Pages 速查

说明
站点地址https://&lt;user&gt;.github.io/<repo>https://&lt;user&gt;.github.io(用户名仓库)
分支 + 目录(//docs),或 GitHub Actions 部署
自定义域名Settings → Pages → Custom domain,CNAME 指向
HTTPS自带 Let's Encrypt
流量不限
构建工具Jekyll(默认)/ VitePress / Docusaurus / Hugo(用 Actions)

安全能力对照

能力作用计划
Dependabot alerts依赖漏洞告警Free
Dependabot updates自动开 PR 升级依赖Free
Secret scanning扫描泄露的 tokenFree(公开库)/ 付费(私有库)
Code scanning (CodeQL)代码安全分析Free(公开库)
Branch protection分支保护规则Free
Required reviewers强制评审人数Free
Environment protection部署环境保护Free
Audit log审计日志Enterprise

平台对比速查

维度GitHubGitLabGitee
CI/CDActions(生态强)built-in(深度集成)Go(轻量)
AI 助手Copilot(领先)DuoAI 队友
自托管Enterprise ServerCE/EE企业版私有化
国内速度
开源生态全球第一国内为主
公开库审核需人工审核

迁移

方向工具
GitHub → GitLabGitLab 导入工具(URL + token)
GitHub → GiteeGitee 「导入 GitHub 仓库」(OAuth 授权)
任意 → GitHubgit remote add + git push,或 GitHub Importer

参考