- API Endpoint:
/repos/{owner}/{repo}/dependency-graph/snapshots- Method: POST
- Headers:
accept: application/vnd.github.v4+jsonauthorization: token <YOUR-TOKEN>
The JSON payload to be submitted should conform to the following structure:
- version: An integer indicating the version of the snapshot format.
- sha: A string representing the commit SHA for which the snapshot applies.
- ref: A string representing the Git reference (e.g., refs/heads/main).
- job: A string uniquely identifying the job run.
- detector: An object containing details about the tool used to detect the dependencies:
- name: The name of the tool.
- version: The version of the tool.
- url: The URL of the tool's documentation.
- metadata (optional): Additional information about the environment, job, scanner, and scan ID.
- dependencies: An array of objects representing dependencies, each containing:
- ref: A string representing the reference to the dependency.
- metadata (optional): Additional metadata about the dependency.
- Required properties:
version,sha,ref,job,detector, anddependencies. detectorobject must containname,version, andurl.