Skip to content

Latest commit

 

History

History
115 lines (85 loc) · 9.66 KB

File metadata and controls

115 lines (85 loc) · 9.66 KB
title intro redirect_from versions type topics shortTitle
About the dependency graph
You can use the dependency graph to identify all your project's dependencies. The dependency graph supports a range of popular package ecosystems.
/github/visualizing-repository-data-with-graphs/about-the-dependency-graph
/code-security/supply-chain-security/about-the-dependency-graph
fpt ghes ghae ghec
*
*
issue-4864
*
overview
Dependency graph
Dependencies
Repositories
Dependency graph

Dependency graph availability

{% ifversion fpt or ghec %}The dependency graph is available for every public repository that defines dependencies in a supported package ecosystem using a supported file format. Repository administrators can also set up the dependency graph for private repositories.{% endif %}

{% data reusables.dependabot.dependabot-alerts-dependency-graph-enterprise %}

About the dependency graph

{% data reusables.dependabot.about-the-dependency-graph %}

When you push a commit to {% data variables.product.product_name %} that changes or adds a supported manifest or lock file to the default branch, the dependency graph is automatically updated.{% ifversion fpt or ghec %} In addition, the graph is updated when anyone pushes a change to the repository of one of your dependencies.{% endif %} For information on the supported ecosystems and manifest files, see "Supported package ecosystems" below.

{% ifversion fpt or ghes > 3.1 or ghae or ghec %} When you create a pull request containing changes to dependencies that targets the default branch, {% data variables.product.prodname_dotcom %} uses the dependency graph to add dependency reviews to the pull request. These indicate whether the dependencies contain vulnerabilities and, if so, the version of the dependency in which the vulnerability was fixed. For more information, see "About dependency review." {% endif %}

Dependencies included

The dependency graph includes all the dependencies of a repository that are detailed in the manifest and lock files, or their equivalent, for supported ecosystems. This includes:

  • Direct dependencies, that are explicitly defined in a manifest or lock file
  • Indirect dependencies of these direct dependencies, also known as transitive dependencies or sub-dependencies

The dependency graph identifies indirect dependencies{% ifversion fpt or ghec %} either explicitly from a lock file or by checking the dependencies of your direct dependencies. For the most reliable graph, you should use lock files (or their equivalent) because they define exactly which versions of the direct and indirect dependencies you currently use. If you use lock files, you also ensure that all contributors to the repository are using the same versions, which will make it easier for you to test and debug code{% else %} from the lock files{% endif %}.

{% ifversion fpt or ghec %}

Dependents included

For public repositories, only public repositories that depend on it or on packages that it publishes are reported. This information is not reported for private repositories.{% endif %}

Using the dependency graph

You can use the dependency graph to:

Enabling the dependency graph

{% ifversion fpt or ghec %}To generate a dependency graph, {% data variables.product.product_name %} needs read-only access to the dependency manifest and lock files for a repository. The dependency graph is automatically generated for all public repositories and you can choose to enable it for private repositories. For information about enabling or disabling it for private repositories, see "Exploring the dependencies of a repository."{% endif %}

{% ifversion ghes or ghae %}If the dependency graph is not available in your system, your enterprise owner can enable the dependency graph. For more information, see "Enabling the dependency graph for your enterprise."{% endif %}

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{% ifversion fpt or ghec %} and every push to other repositories in the graph{% endif %}.

Supported package ecosystems

The recommended formats explicitly define which versions are used for all direct and all indirect dependencies. If you use these formats, your dependency graph is more accurate. It also reflects the current build set up and enables the dependency graph to report vulnerabilities in both direct and indirect dependencies.{% ifversion fpt or ghec %} Indirect dependencies that are inferred from a manifest file (or equivalent) are excluded from the checks for vulnerable dependencies.{% endif %}

Package manager Languages Recommended formats All supported formats
Composer PHP composer.lock composer.json, composer.lock
dotnet CLI .NET languages (C#, C++, F#, VB) .csproj, .vbproj, .nuspec, .vcxproj, .fsproj .csproj, .vbproj, .nuspec, .vcxproj, .fsproj, packages.config
{%- if github-actions-in-dependency-graph %}
{% data variables.product.prodname_actions %} workflows[1] YAML .yml, .yaml .yml, .yaml
{%- endif %}
{%- ifversion fpt or ghes > 3.2 or ghae %}
Go modules Go go.sum go.mod, go.sum
{%- elsif ghes = 3.2 %}
Go modules Go go.mod go.mod
{%- endif %}
Maven Java, Scala pom.xml pom.xml
npm JavaScript package-lock.json package-lock.json, package.json
pip Python requirements.txt, pipfile.lock requirements.txt, pipfile, pipfile.lock, setup.py{% if github-actions-in-dependency-graph %}[2]{% else %}[1]{% endif %}
{%- ifversion fpt or ghec or ghes > 3.3 or ghae-issue-4752 %}
Python Poetry Python poetry.lock poetry.lock, pyproject.toml
RubyGems Ruby Gemfile.lock Gemfile.lock, Gemfile, *.gemspec
Yarn JavaScript yarn.lock package.json, yarn.lock

{% if github-actions-in-dependency-graph %} [1] Please note that {% data variables.product.prodname_actions %} workflows must be located in the .github/workflows/ directory of a repository to be recognized as manifests. Any actions or workflows referenced using the syntax jobs[*].steps[*].uses or jobs.<job_id>.uses will be parsed as dependencies. For more information, see "Workflow syntax for GitHub Actions."

[2] If you list your Python dependencies within a setup.py file, we may not be able to parse and list every dependency in your project.

{% else %} [1] If you list your Python dependencies within a setup.py file, we may not be able to parse and list every dependency in your project. {% endif %}

{% if github-actions-in-dependency-graph %} {% note %}

Note: {% data variables.product.prodname_actions %} workflow dependencies are displayed in the dependency graph for informational purposes. Dependabot alerts are not currently supported for {% data variables.product.prodname_actions %} workflows.

{% endnote %} {% endif %}

Further reading