Skip to main content

Exploring the dependencies of a repository

You can use the dependency graph to see the packages your project depends on and the repositories that depend on it. In addition, you can see any vulnerabilities detected in its dependencies.

この機能を使用できるユーザーについて

リポジトリ管理者、組織の所有者、リポジトリへの書き込みまたは保守アクセス権を持つユーザー

Viewing the dependency graph

The dependency graph shows the dependencies and dependents of your repository. 依存関係ごとに、バージョン、ライセンス情報、それを含むマニフェスト ファイル、既知の脆弱性があるかどうかを確認できます。 推移的な依存関係をサポートするパッケージ エコシステムの場合、リレーションシップの状態が表示され、[] をクリックしてから [Show paths] をクリックすると、その依存関係の基になっている推移パスを確認できます。

検索バーを使用して、特定の依存関係を検索することもできます。 依存関係は、脆弱なパッケージが先頭になるように自動的に並べ替えられます。 For information about the detection of dependencies and which ecosystems are supported, see 依存関係グラフでパッケージ エコシステムをサポート.

  1. GitHub で、リポジトリのメイン ページに移動します。

  2. リポジトリ名の下にある [ Insights] をクリックします。

    リポジトリのメイン ページのスクリーンショット。 水平ナビゲーション バーの、グラフ アイコンと [Insights] というラベルが付いたタブが、オレンジ色の枠線で囲まれています。

  3. 左側のサイドバーで、 [Dependency graph] (依存関係グラフ) をクリックします。

    [依存関係グラフ] タブのスクリーンショット。タブはオレンジ色の枠線で強調されています。

  4. Optionally, use the search bar to find a specific dependency or set of dependencies. You can use the keywords ecosystem: to show only packages of a certain type, or relationship: to show only direct or transitive dependencies (if the ecosystem supports transitivity). Plain words in search bar will only match package names.

  5. Optionally, to view the repositories and packages that depend on your repository, under "Dependency graph", click Dependents.

    Screenshot of the "Dependency graph" page. The "Dependents" tab is highlighted with an orange outline.

    メモ

    GitHub currently only determines dependents for public repositories.

Dependencies view

For each dependency, you can see its ecosystem, the manifest file in which it was found, and its license (where detected).

  • Dependencies for private repositories, private packages, or unrecognized files are shown in plain text.

  • If the package manager for the dependency is in a public repository, you can hover on the dependency name to display a pop-up with the associated repository information.

  • You can sort and filter dependencies by typing filters as key:value pairs into the search bar.

    • Use ecosystem: <ecosystem-name> to display dependencies for the selected ecosystem.
    • Use relationship: to filter the list by relationship status. Possible values are direct, transitive, and inconclusive. Alternatively, you can click the relationship label adjacent to a dependency name to only show dependencies of the same relationship status. This filter is only available for ecosystems with transitive dependency support. See 依存関係グラフでパッケージ エコシステムをサポート for more information.

Dependencies submitted to a project using the 依存関係送信 API will show which detector was used for their submission and when they were submitted. For more information on using the 依存関係送信 API, see Using the dependency submission API.

If vulnerabilities have been detected in the repository, these are shown at the top of the view for users with access to Dependabot alerts.

Dependents view

For public repositories, the dependents view shows how the repository is used by other repositories. To show only the repositories that contain a library in a package manager, click NUMBER Packages immediately above the list of dependent repositories. The dependent counts are approximate and may not always match the dependents listed.

Enabling and disabling the dependency graph

リポジトリ管理者は、可視性に関係なく、ユーザー アカウントが所有するすべてのリポジトリの依存関係グラフを有効または無効にすることができます。 「セキュリティと分析機能の管理」を参照してください。

組織内の複数のリポジトリに対して同時に依存関係グラフを有効にすることもできます。 詳細については、「組織のセキュリティ」を参照してください。

  1. GitHub で、リポジトリのメイン ページに移動します。

  2. リポジトリ名の下にある [Settings] をクリックします。 [設定] タブが表示されない場合は、 [] ドロップダウン メニューを選び、 [設定] をクリックします。

    タブを示すリポジトリ ヘッダーのスクリーンショット。 [設定] タブが濃いオレンジ色の枠線で強調表示されています。

  3. サイドバーの [Security] セクションで、[ Advanced Security] をクリックします。

  4. 依存関係グラフを有効にするにはリポジトリ データへの読み取りアクセスを GitHub に許可することに関するメッセージを読み、[Dependency Graph] の隣にある [Enable] をクリックします。

    [Advanced Security] の設定ページで、[Dependency Graph] の横にある [Disable] をクリックして、いつでも依存関係グラフを無効にできます。

Changing the "Used by" package

You may notice some repositories have a "Used by" section in the sidebar of the Code tab. Your repository will have a "Used by" section if:

  • The dependency graph is enabled for the repository (see the above section for more details).
  • Your repository contains a package that is published on a supported package ecosystem.
  • Within the ecosystem, your package has a link to a public repository where the source is stored.
  • More than 100 repositories depend on your package.

The "Used by" section shows the number of public references to the package that were found, and displays the avatars of some of the owners of the dependent projects.

Screenshot of the "Used by" section for a repository showing the summary of "13.4m" with details of 8 avatars and "+13,435,819."

Clicking any item in this section takes you to the Dependents tab of the dependency graph.

The "Used by" section represents a single package from the repository. If you have admin permissions to a repository that contains multiple packages, you can choose which package the "Used by" section represents.

  1. GitHub で、リポジトリのメイン ページに移動します。

  2. リポジトリ名の下にある [Settings] をクリックします。 [設定] タブが表示されない場合は、 [] ドロップダウン メニューを選び、 [設定] をクリックします。

    タブを示すリポジトリ ヘッダーのスクリーンショット。 [設定] タブが濃いオレンジ色の枠線で強調表示されています。

  3. サイドバーの [Security] セクションで、[ Advanced Security] をクリックします。

  4. Under "Advanced Security", click the drop-down menu in the "Used by counter" section and choose a package.

Further reading