Skip to content

How to extract the dependencies of a repository? #2145

@tohidemyname

Description

@tohidemyname

I notice that Github has a rest api to retrieve the dependencies of a repository:

https://docs.github.com/en/rest/dependency-graph/sboms?apiVersion=2022-11-28#export-a-software-bill-of-materials-sbom-for-a-repository

However, I did not find a corresponding API call in github-api. I tried to implement the api by myself:

public List<Dependence> getDependGraph() throws IOException {
		Dependence[] list = root().createRequest()
	                .withUrlPath(getApiTailUrl("dependency-graph/sbom"))
	                .fetch(Dependence[].class);
	    return Arrays.asList(list);
		
	}

The above code returns a 404 error:

org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/sgtest/pinned-lucene/stats/dependency-graph/sbom {
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest",
  "status": "404"
}

I tried to call the url:
https://api.github.com/repos/sgtest/pinned-lucene/stats/dependency-graph/sbom

It also returns a 404 error.

Is this a problem in Github? Would you please give me some suggestions on how to implement the API for github-api?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions