关于 Dependabot 运行器上的 GitHub Actions
重要
如果为仓库启用了 Dependabot,它将始终在 GitHub Actions 上运行,并绕过 Actions 策略检查以及仓库或组织级别的禁用设置。 这可确保在启用 Dependabot 时始终运行安全和版本更新工作流。
使用 GitHub Actions 运行器可以更轻松地识别 Dependabot 作业错误,并手动检测和排查失败的作业。 你还可以通过将 Dependabot 集成到你的 CI/CD 管道中,使用 GitHub Actions API 和 Webhook 来检测 Dependabot 作业状态,如失败的运行,并执行下游处理。 有关详细信息,请参阅 GitHub Actions 的 REST API 端点 和 Webhook 事件和有效负载。
如果你在用户帐户或组织中创建的新存储库满足以下任一条件,它们将自动配置为在 Dependabot 上使用标准 GitHub Actions 托管运行器运行 GitHub:
- Dependabot 已安装并启用,并且 GitHub Actions 已启用且正在使用中。
- 你的组织的“Dependabot运行器上的 GitHub Actions”设置已启用。
GitHub的未来版本将移除禁用在Dependabot上运行GitHub Actions的功能。
注意
在 Dependabot 上启用 GitHub Actions 可能会增加你帐户中运行的并发作业数量。 如果需要,使用企业计划的客户可请求更高的并发作业数限制。 如需了解更多信息,请通过GitHub 支持门户联系我们,或联系您的销售代表。
运行器选项
您可以使用以下方式在Dependabot上运行GitHub Actions:
-
**标准 GitHub 托管运行器。** 这些是用于 GitHub 执行 GitHub Actions 作业的默认运行程序。 - 大型运行器。 这些是 GitHub托管运行程序,具有更多 RAM、CPU 和磁盘空间等高级功能。 有关详细信息,请参阅“使用较大运行器”。
-
**自托管运行器。** 这些运行器让你更好地控制 Dependabot 对私有注册表和内部网络资源的访问。 请注意,出于安全原因,Dependabot updates 在自托管运行器上不会在公共存储库上运行。 有关在自托管运行程序上分配 `dependabot` 标签的详细信息,请参阅 [AUTOTITLE](/code-security/how-tos/secure-your-supply-chain/manage-your-dependency-security/configure-on-self-hosted-runners)。
在标准 Dependabot 托管运行器或自托管运行器上运行 GitHub 不计入你包含的 GitHub Actions 分钟数。 对于 Dependabot 上的 大型运行器,GitHub 将按标准费率向贵组织计费。 请参阅“Actions 运行程序定价”。
注意
Azure 虚拟网络(VNET)或 Actions Runner Controller(ARC)支持 Dependabot 在 GitHub Actions 上的专用网络。 请参阅“设置 Dependabot 以使用 Actions Runner Controller 在自托管操作运行器上运行”和“使用Azure专用网络设置 Dependabot 以在 github 托管的操作运行程序上运行”。
运行器设置如何交互
Dependabot 运行器上的 GitHub Actions 和自托管运行器设置上的 Dependabot 是相互依存的:
- 启用“自托管运行器上的 Dependabot”会自动启用“Dependabot 运行器上的 GitHub Actions”。 禁用“Dependabot 运行器上的 GitHub Actions”会自动禁用“自托管运行器上的 Dependabot”。
- 当两个设置都启用时,Dependabot 作业仅在自托管运行器或带有
dependabot标签的 大型运行器 上运行 — 不在标准 GitHub 托管运行器上运行。
警告
如果两个设置都启用,但没有可用的自托管运行器或带有 dependabot 标签的 大型运行器,Dependabot 作业将无限期地保持排队状态。 在启用“自托管运行器上的 Dependabot”之前,确保配置了带有此标签的运行器。
访问和权限
如果要转换到在 Dependabot 运行程序上使用 GitHub Actions ,并且限制对组织的或存储库专用资源的访问,则可能需要更新允许的 IP 地址列表。 例如,如果你目前将私有资源的访问限制在 Dependabot 使用的 IP 地址,你应该更新你的允许列表,以使用源自元 API 终结点的 GitHub 托管运行器 IP 地址。 有关详细信息,请参阅“元数据的 REST API 端点”。
后续步骤
若要在 Dependabot 运行器上启用 GitHub Actions,请参阅 在 GitHub 托管的运行程序上配置 Dependabot 和 在自托管运行器上配置 Dependabot。