v50

latestOpenAPI 3.0.3MITraw.githubusercontent.com2024-01-0382859610.0 MB
dependency-graph

Create a snapshot of dependencies for a repository

Create a new snapshot of a repository's dependencies. You must authenticate using an access token with the repo scope to use this endpoint for a repository that the requesting user has access to.

post/repos/{owner}/{repo}/dependency-graph/snapshots

Path parameters

ownerstring required

The account owner of the repository. The name is not case sensitive.

repostring required

The name of the repository without the .git extension. The name is not case sensitive.

Request body

versioninteger required

The version of the repository snapshot submission.

shastring required

The commit SHA associated with this dependency snapshot. Maximum length: 40 characters.

refstring required

The repository branch that triggered this snapshot.

metadataMetadata

User-defined metadata to store domain-specific information limited to 8 keys with scalar values.

manifestsobject

A collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies.

scannedstring date-time required

The time at which the snapshot was scanned.

Example request

{
  "job": {
    "id": "5622a2b0-63f6-4732-8c34-a1ab27e102a11",
    "correlator": "yourworkflowname_yourjobname",
    "html_url": "http://example.com/build"
  },
  "sha": "ddc951f4b1293222421f2c8df679786153acf689",
  "ref": "refs/heads/main",
  "detector": {
    "name": "docker buildtime detector",
    "version": "1.0.0",
    "url": "http://example.com/docker-buildtimer-detector"
  },
  "scanned": "2020-06-13T14:52:50-05:00"
}

Response

Response

idinteger required

ID of the created snapshot.

created_atstring required

The time at which the snapshot was created.

resultstring required

Either "SUCCESS", "ACCEPTED", or "INVALID". "SUCCESS" indicates that the snapshot was successfully created and the repository's dependencies were updated. "ACCEPTED" indicates that the snapshot was successfully created, but the repository's dependencies were not updated. "INVALID" indicates that the snapshot was malformed.

messagestring required

A message providing further details about the result, such as why the dependencies were not updated.