简体   繁体   English

如何将 Dependabot 与私有包一起使用

[英]How to use Dependabot with private packages

I need some help with Dependabot .我需要Dependabot 的一些帮助。 I found out recently about this amazing package, but some of my repositories require dependencies that are private packages , created by me and used in my personal projects.我最近发现了这个惊人的包,但我的一些存储库需要私有包的依赖项,由我创建并在我的个人项目中使用。 Dependabot says that for any repositories using private packages, it is advised better to be configured from their website's dashboard . Dependabot 表示,对于任何使用私有包的存储库,建议最好从其网站的仪表板进行配置。

In my repo , I have moved Dependabot's configuration into the .github/dependabot.yml file, from the dashboard that was located before.在我的repo 中,我已将 Dependabot 的配置从之前位于的仪表板移动到.github/dependabot.yml文件中。 In the Insights tab of the repo, and in the Dependact Graph section, the error about not finding the private package is also being thrown there.在 repo 的Insights选项卡中,以及Dependact Graph部分中,关于找不到私有包的错误也在那里抛出。 Has anyone implemented something similar?有没有人实现过类似的东西? I would really appreciate your support here.我真的很感谢你在这里的支持。

There is now more documentation on this, considering since Dec. 2nd, 2020:考虑到自 2020 年 12 月 2 日以来,现在有更多关于此的文档:

Dependabot: version updates from private GitHub repositories Dependabot:来自私有 GitHub 存储库的版本更新

Dependabot already updates your public dependencies, such as open source dependencies from a public GitHub repository, npm , Maven Central, or similar. Dependabot 已经更新了您的公共依赖项,例如来自公共 GitHub 存储库、 npm 、Maven Central 或类似库的开源依赖项。

Now, you can also update dependencies from private GitHub repositories.现在,您还可以从私有 GitHub 存储库更新依赖项。 This feature is available for most package managers supported by Dependabot version updates , except bundler , hex , and pip .此功能可用于Dependabot 版本更新支持的大多数包管理器,但bundlerhexpip除外。

To get started, grant Dependabot access to some or all of your private repositories on your organization's security & analysis settings page:首先,在您组织的安全和分析设置页面上授予 Dependabot 访问您的部分或全部私有存储库的权限

 https://github.com/organizations/YOUR-ORGANIZATION/settings/security_analysis.

Learn more about Dependabot version updates .了解有关Dependabot 版本更新的更多信息。


March 2021: 2021 年 3 月:

Dependabot private registry support public beta Dependabot 私有注册表支持公开测试版

Dependabot can now access dependencies from authenticated private registries, such as GitHub Packages, Azure Artifacts, and Artifactory. Dependabot 现在可以从经过身份验证的私有注册表访问依赖项,例如 GitHub Packages、Azure Artifacts 和 Artifactory。 These private registries are similar to their public equivalents, but they require authentication and are only available to members of your team or company.这些私有注册表类似于它们的公共注册表,但它们需要身份验证并且仅对您的团队或公司的成员可用。 With this release, Dependabot version updates can help keep inner source as up-to-date as open source.在此版本中,Dependabot 版本更新可以帮助保持内部源代码与开源一样最新。

To enable this feature, add a registries section to your dependabot.yml, reference your new registries in the relevant updates, and add any secrets to Dependabot's secret store .要启用此功能,请在您的dependabot.yml 中添加一个registries 部分,在相关更新中引用您的新注册表, 并将任何秘密添加到 Dependabot 的秘密存储中

This complements your ability to give Dependabot version updates access to private repositories , which is common for ecosystems like go modules and npm.这补充了您赋予 Dependabot 版本更新访问私有存储库的能力,这在 go modules 和 npm 等生态系统中很常见。

Although, there is not much information and documentation for this particular topic, I managed to solve my issue.尽管此特定主题的信息和文档不多,但我还是设法解决了我的问题。 It is a combination of GitHub Secrets and configuration of the .npmrc & .yarnrc files.它是GitHub Secrets.npmrc.yarnrc文件配置的组合。 You can found the related issue, as well as my official answer, here .您可以在此处找到相关问题以及我的官方回答。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM