Skip to main content

Enabling the dependency graph

You can allow users to identify their projects' dependencies by enabling the dependency graph.

谁可以使用此功能?

具有管理员角色的存储库所有者、组织所有者、安全管理员和用户

The dependency graph is a summary of the manifest and lock files stored in a repository and any dependencies that are submitted for the repository using the 依赖项提交 API. For more information, see 关于依赖关系图.

When the dependency graph is first enabled, any manifest and lock files for supported ecosystems are parsed immediately. The graph is usually populated within minutes but this may take longer for repositories with many dependencies. Once enabled, the graph is automatically updated with every push to the repository and every push to other repositories in the graph.

Enabling the dependency graph for a repository

Enabling the dependency graph gives GitHub read-only access to the dependency manifest and lock files for a repository.

存储库管理员可启用或禁用你的用户帐户拥有的所有存储库的依赖项关系图,无论其可见性如何。 请参阅“管理安全和分析功能”。

还可以同时为组织中的多个存储库启用依赖项关系图。 有关详细信息,请参阅“配置组织安全性”。

  1. 在 GitHub 上,导航到存储库的主页面。

  2. 在仓库名称下,单击 “Settings”****。 如果看不到“设置”选项卡,请选择“”下拉菜单,然后单击“设置”。

    存储库标头的屏幕截图,其中显示了选项卡。 “设置”选项卡以深橙色边框突出显示。

  3. 在边栏的“Security”部分中,单击“ Advanced Security”****。

  4. 阅读有关授予 GitHub 对仓库数据的只读访问权限的消息,以启用依赖项关系图,然后在“依赖项关系图”旁边单击“启用”****。

    可以随时单击“Advanced Security”的设置页上“依赖项关系图”旁边的“禁用”来禁用依赖项关系图****。

Enabling the dependency graph for multiple repositories

You can enable or disable the dependency graph for all repositories owned by your user account, regardless of their visibility. See 管理安全和分析功能.

You can also enable the dependency graph for multiple repositories in an organization at the same time. For more information, see 配置组织安全性.

Next steps

此外,可以使用 依赖项提交 API 从所选的包管理器或生态系统提交依赖项,即使依赖项关系图不支持使用该生态系统进行清单或锁定文件分析也是如此。 使用 依赖项提交 API 提交到项目的依赖项将显示用于提交的检测器以及提交时间。 有关 依赖项提交 API 的详细信息,请参阅 使用依赖项提交 API

For more information on viewing the dependency graph, see 探索仓库的依赖项.

Further reading