{"meta":{"title":"依赖项关系图","intro":"您可以使用依赖关系图来识别项目的所有依赖项。 依赖关系图支持一系列流行的软件包生态系统。","product":"安全性和代码质量","breadcrumbs":[{"href":"/zh/enterprise-server@3.20/code-security","title":"安全性和代码质量"},{"href":"/zh/enterprise-server@3.20/code-security/concepts","title":"Concepts"},{"href":"/zh/enterprise-server@3.20/code-security/concepts/supply-chain-security","title":"供应链安全"},{"href":"/zh/enterprise-server@3.20/code-security/concepts/supply-chain-security/dependency-graph","title":"依赖项关系图"}],"documentType":"article"},"body":"# 依赖项关系图\n\n您可以使用依赖关系图来识别项目的所有依赖项。 依赖关系图支持一系列流行的软件包生态系统。\n\n<!--Marketing-LINK: From /features/security and /features/security/software-supply-chain pages \"How GitHub's dependency graph is generated\".-->\n\n## 关于依赖关系图\n\n依赖项关系图是存储在存储库中的清单和锁定文件以及使用 依赖项提交 API 提交给存储库的任何依赖项的摘要。 对于每个存储库，它显示 依赖关系，即它所依赖的生态系统和包。\n\n对于每个依赖项，可以看到版本、包含它的清单文件，以及它是否具有已知漏洞。 对于支持传递性依赖项的包生态系统，将显示依赖关系状态。你可以单击 <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-kebab-horizontal\" aria-label=\"Show dependency options\" role=\"img\"><path d=\"M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z\"></path></svg>，然后选择“Show paths”，以查看引入该依赖项的传递路径。\n\n还可以使用搜索栏搜索特定依赖项。 依赖项会自动排序，存在漏洞的包排在最上方。\n\nGitHub 不检索依赖项的许可信息，也不计算有关依赖项、仓库和依赖于仓库的包的信息。\n\n有关受支持生态系统和清单文件的信息，请参阅 [依赖项关系图支持的包生态系统](/zh/enterprise-server@3.20/code-security/reference/supply-chain-security/dependency-graph-supported-package-ecosystems#supported-package-ecosystems)。\n\n当你创建一个针对默认分支且包含依赖项更改的拉取请求时，GitHub 会使用依赖关系图将依赖项审查添加到该拉取请求中。 它们指示依赖项是否包含漏洞，如果是，则指示已修复漏洞的依赖项版本。 有关详细信息，请参阅“[依赖项审查](/zh/enterprise-server@3.20/code-security/concepts/supply-chain-security/dependency-review)”。\n\n## 如何生成依赖项关系图\n\n依赖项关系图通过分析存储库中的清单和锁定文件来自动分析依赖项。 还可以自行提交数据。 有关详细信息，请参阅“[依赖项图如何识别依赖项](/zh/enterprise-server@3.20/code-security/concepts/supply-chain-security/dependency-graph-data)”。\n\n## 依赖关系图可用性\n\n企业所有者可以为企业配置依赖关系图和 Dependabot alerts。 有关详细信息，请参阅 [为企业启用依赖项关系图](/zh/enterprise-server@3.20/code-security/how-tos/secure-at-scale/configure-enterprise-security/configure-specific-tools/enable-dependency-graph) 和 [为企业启用 Dependabot](/zh/enterprise-server@3.20/admin/configuring-settings/configuring-github-connect/enabling-dependabot-for-your-enterprise)。\n\n有关依赖项图配置的详细信息，请参阅 [启用依赖项关系图](/zh/enterprise-server@3.20/code-security/how-tos/secure-your-supply-chain/secure-your-dependencies/enable-dependency-graph)。\n\n## 如何使用依赖项图处理任务\n\n您可以使用依赖关系图：\n\n* 查看代码依赖的存储库。 有关详细信息，请参阅“[探索仓库的依赖项](/zh/enterprise-server@3.20/code-security/how-tos/secure-your-supply-chain/secure-your-dependencies/explore-dependencies)”。\n* 查看和更新仓库中有漏洞的依赖项。 有关详细信息，请参阅“[Dependabot 警报](/zh/enterprise-server@3.20/code-security/concepts/supply-chain-security/dependabot-alerts)”。\n* 查看拉取请求中有漏洞依赖项的相关信息。 有关详细信息，请参阅“[审核拉取请求中的依赖项变更](/zh/enterprise-server@3.20/pull-requests/how-tos/review-pull-requests/reviewing-dependency-changes-in-a-pull-request)”。\n* 导出软件物料清单（SBOM），以便进行审核或合规性目的。 这是项目依赖项的正式计算机可读清单。 请参阅“[导出存储库的软件物料清单](/zh/enterprise-server@3.20/code-security/how-tos/secure-your-supply-chain/establish-provenance-and-integrity/export-dependencies-as-sbom)”。\n\n## 延伸阅读\n\n* [依赖图](https://en.wikipedia.org/wiki/Dependency_graph)在维基百科上的介绍\n* [探索仓库的依赖项](/zh/enterprise-server@3.20/code-security/how-tos/secure-your-supply-chain/secure-your-dependencies/explore-dependencies)\n* [查看和更新 Dependabot 警报](/zh/enterprise-server@3.20/code-security/how-tos/manage-security-alerts/manage-dependabot-alerts/view-dependabot-alerts)\n* [脆弱性依赖检测](/zh/enterprise-server@3.20/code-security/reference/supply-chain-security/troubleshoot-dependabot/vulnerability-detection)"}