Dependency Graph

Endpoints to access Dependency Graph features.

Operations

MethodEndpointDescription
GET/repos/{owner}/{repo}/dependency-graph/compare/{basehead}Get a diff of the dependencies between commits
GET/repos/{owner}/{repo}/dependency-graph/sbomExport a software bill of materials (SBOM) for a repository.
GET/repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}Fetch a software bill of materials (SBOM) for a repository.
GET/repos/{owner}/{repo}/dependency-graph/sbom/generate-reportRequest generation of a software bill of materials (SBOM) for a repository.
POST/repos/{owner}/{repo}/dependency-graph/snapshotsCreate a snapshot of dependencies for a repository

Example

Get a diff of the dependencies between commits, with the TypeScript SDK:

ts
import { GitHubV3REST } from "github";

const client = new GitHubV3REST({
  baseUrl: "https://api.github.com",
});

const result = await client.dependencyGraph.diffRange({
  owner: "owner",
  repo: "repo",
  basehead: "basehead",
});
console.log(result);
Nine more languages

The same call exists in every SDK. See SDKs for the other nine.