我在公司 GitHub 组织内有一个存储库,它使用 Dependabot 使其 GitHub Actions 依赖项保持最新,包括可重用的工作流程:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
day: 'wednesday'
target-branch: 'main'
rebase-strategy: 'auto'
commit-message:
prefix: 'chore'
include: 'scope'
open-pull-requests-limit: 10
groups:
dotnet:
patterns:
- '*' # Prefer a single PR per solution update.
问题是 Dependabot 失败,因为它无法访问同一组织内具有可重用工作流程的存储库来检查更新:
错误:
Dependabot 未能更新您的依赖项以下 git 存储库无法访问并导致更新失败: 注册变更管理事件操作。
Dependabot 无法更新引用私有 git 的依赖文件 其他帐户拥有的存储库。请考虑使用 git 注册表。
如何允许 Dependabot 访问我组织的存储库?我不想使用 PAT,因为存储库是共享的。
注意:工作流程可以毫无问题地访问 GitHub 包
这是一个组织级别的设置,您可以在其中显式定义 Dependabot 有权访问的所有内部/私有存储库。请参阅文档:授予 Dependabot 对私有存储库的访问权限
该设置位于“设置”>“代码安全性”>“全局设置”>“授予 Dependabot 访问私有存储库的权限”下,URL https://github.com/organizations/YOURORG/settings/security_analysis