{"meta":{"title":"Dependabot 版本更新","intro":"你可以使用 Dependabot 来使你使用的软件包保持更新到最新版本。","product":"安全性和代码质量","breadcrumbs":[{"href":"/zh/code-security","title":"安全性和代码质量"},{"href":"/zh/code-security/concepts","title":"Concepts"},{"href":"/zh/code-security/concepts/supply-chain-security","title":"供应链安全"},{"href":"/zh/code-security/concepts/supply-chain-security/dependabot-version-updates","title":"Dependabot 版本更新"}],"documentType":"article"},"body":"# Dependabot 版本更新\n\n你可以使用 Dependabot 来使你使用的软件包保持更新到最新版本。\n\n## 关于 Dependabot version updates\n\nDependabot 可让您省去维护依赖项的麻烦。 您可以使用它来确保仓库自动跟上它所依赖的包和应用程序的最新版本。\n\n当 Dependabot 提出拉取请求时，这些拉取请求可以是安全更新或版本更新：\n\n* Dependabot security updates 是自动拉取请求，可帮助你更新已知漏洞的信赖项。\n* Dependabot version updates 是自动拉取请求，即使它们没有任何漏洞，也会保持更新依赖项。 要检查版本更新的状态，请导航到你的仓库的“Insights”选项卡，然后选择“Dependency Graph”和“Dependabot”。\\*\\*\\*\\*\\*\\*\\*\\*\n\n通过将 `dependabot.yml` 配置文件签入存储库，可启用 Dependabot version updates。\n\nDependabot 和所有相关功能受 [GitHub 服务条款](/zh/site-policy/github-terms/github-terms-of-service)约束。\n\n## 软件包更新\n\n配置文件 `dependabot.yml` 指定存储在存储库中的清单或其他包定义文件的位置。\nDependabot 使用此信息检查过时的包和应用程序。\nDependabot 通过查看依赖项的语义化版本控制（[semver](https://semver.org/)）来判断该依赖项是否有新版本，并决定是否应更新到该版本。 有关受支持的仓库和生态系统的详细信息，请参阅“[Dependabot 支持的生态系统和存储库](/zh/code-security/dependabot/ecosystems-supported-by-dependabot/supported-ecosystems-and-repositories)”。\n\n`dependabot.yml` 文件还可以进行配置，以告知 Dependabot 如何维护您的依赖项。 有关详细信息，请参阅“[关于 dependabot.yml 文件](/zh/code-security/concepts/supply-chain-security/about-the-dependabot-yml-file)”。\n\n对于某些包管理器，Dependabot version updates 也支持供应。 供应（或缓存）的依赖项是检入仓库中特定目录的依赖项，而不是在清单中引用的依赖项。 即使包服务器不可用，供应的依赖项在生成时也可用。\nDependabot version updates 可配置为检查供应商的新版本依赖项，并在必要时更新它们。\n\n标识过时的依赖项时 Dependabot ，它会引发拉取请求，以将清单更新到最新版本的依赖项。 对于供应商的依赖项， Dependabot 引发拉取请求，以将过时的依赖项直接替换为新版本。 检查测试是否通过，查看拉取请求摘要中包含的更改日志和发行说明，然后合并它。 有关详细信息，请参阅“[配置 Dependabot 版本更新](/zh/code-security/how-tos/secure-your-supply-chain/secure-your-dependencies/configure-version-updates)”。\n\n默认情况下，Dependabot 会对版本更新应用 3 天的冷却期，因此新版本在发布满 3 天之前不会被纳入版本更新考虑。\n**此默认冷却不适用于安全更新。** 这样，新版本就可以在收到拉取请求之前稳定下来。 可以使用该选项自定义冷却期及其适用的 `cooldown` 依赖项。 有关详细信息，请参阅“[Dependabot 选项参考](/zh/code-security/reference/supply-chain-security/dependabot-options-reference#cooldown-)”。\n\n如果启用 *安全更新*， Dependabot 还会引发拉取请求以更新易受攻击的依赖项。 有关详细信息，请参阅“[Dependabot 安全更新](/zh/code-security/concepts/supply-chain-security/dependabot-security-updates)”。\n\n## 针对操作的更新\n\n操作通常使用漏洞修复和新功能进行更新，以使自动化流程更可靠、更快速、更安全。 为Dependabot version updates启用GitHub Actions后，Dependabot将帮助确保存储库中的\\_workflow\\.yml\\_文件内对操作的引用，以及工作流内部使用的可重用工作流，始终保持最新。\n\n对于文件中的每个操作，Dependabot 都会将该操作的引用（通常是与该操作关联的版本号或提交标识符）与最新版本进行比对。 如果操作的最新版本可用， Dependabot 则会向你发送一个拉取请求，该请求将工作流文件中的引用更新为最新版本。\n\nDependabot 还会检查工作流文件中对可重用工作流的使用情况，并更新这些被调用的可重用工作流的 Git 引用。\n\n若要启用此功能，请参阅 [使用 Dependabot 保持操作的最新状态](/zh/code-security/how-tos/secure-your-supply-chain/secure-your-dependencies/auto-update-actions)。\n\n## 关于自动停用 Dependabot updates\n\n当存储库的维护者停止处理 Dependabot 拉取请求时，Dependabot 会暂时暂停更新并通知你，请参阅 [不再生成 Dependabot 更新拉取请求](/zh/code-security/reference/supply-chain-security/troubleshoot-dependabot/dependabot-updates-stopped)。\n\n## 关于 Dependabot 版本更新通知\n\n可以按 GitHub 筛选通知，以显示由 Dependabot 创建的拉取请求的通知。 有关详细信息，请参阅“[在收件箱中管理通知](/zh/subscriptions-and-notifications/how-tos/viewing-and-triaging-notifications/managing-notifications-from-your-inbox)”。"}