Dependency Graph
Endpoints to access Dependency Graph features.
Operations
| Method | Endpoint | Description |
|---|---|---|
GET | /repos/{owner}/{repo}/dependency-graph/compare/{basehead} | Get a diff of the dependencies between commits |
GET | /repos/{owner}/{repo}/dependency-graph/sbom | Export 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-report | Request generation of a software bill of materials (SBOM) for a repository. |
POST | /repos/{owner}/{repo}/dependency-graph/snapshots | Create 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.