repo
scope to use this endpoint for a repository that the requesting user has access to.curl --location --request POST 'https://api.github.com/repos///dependency-graph/snapshots' \
--header 'Content-Type: application/json' \
--data-raw '{
"detector": {
"name": "docker buildtime detector",
"url": "http://example.com/docker-buildtimer-detector",
"version": "1.0.0"
},
"job": {
"correlator": "yourworkflowname_yourjobname",
"html_url": "http://example.com/build",
"id": "5622a2b0-63f6-4732-8c34-a1ab27e102a11"
},
"manifests": {
"property1": {
"file": {
"source_location": "/src/build/package-lock.json"
},
"metadata": {
"property1": "string",
"property2": "string"
},
"name": "package-lock.json",
"resolved": {
"property1": {
"dependencies": "@actions/http-client",
"metadata": {
"property1": "string",
"property2": "string"
},
"package_url": "pkg:/npm/%40actions/http-client@1.0.11",
"relationship": "direct",
"scope": "runtime"
},
"property2": {
"dependencies": "@actions/http-client",
"metadata": {
"property1": "string",
"property2": "string"
},
"package_url": "pkg:/npm/%40actions/http-client@1.0.11",
"relationship": "direct",
"scope": "runtime"
}
}
},
"property2": {
"file": {
"source_location": "/src/build/package-lock.json"
},
"metadata": {
"property1": "string",
"property2": "string"
},
"name": "package-lock.json",
"resolved": {
"property1": {
"dependencies": "@actions/http-client",
"metadata": {
"property1": "string",
"property2": "string"
},
"package_url": "pkg:/npm/%40actions/http-client@1.0.11",
"relationship": "direct",
"scope": "runtime"
},
"property2": {
"dependencies": "@actions/http-client",
"metadata": {
"property1": "string",
"property2": "string"
},
"package_url": "pkg:/npm/%40actions/http-client@1.0.11",
"relationship": "direct",
"scope": "runtime"
}
}
}
},
"metadata": {
"property1": "string",
"property2": "string"
},
"ref": "refs/heads/main",
"scanned": "2020-06-13T19:52:50.000Z",
"sha": "ddc951f4b1293222421f2c8df679786153acf689",
"version": 0
}'
{
"created_at": "string",
"id": 0,
"message": "string",
"result": "string"
}
job.correlator
and detector.name
will be considered when calculating a repository's current dependencies. Correlator should be as unique as it takes to distinguish all detection runs for a given "wave" of CI workflow you run. If you're using GitHub Actions, a good default value for this could be the environment variables GITHUB_WORKFLOW and GITHUB_JOB concatenated together. If you're using a build matrix, then you'll also need to add additional key(s) to distinguish between each submission inside a matrix variation.