Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/main/java/org/kohsuke/github/GHRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,20 @@ public GHRelease getReleaseByTagName(String tag) throws IOException {
}
}

/**
* Exports the software bill of materials (SBOM) for a repository.
*
* @return the SBOM export result containing the SPDX-formatted SBOM
* @throws IOException
* the io exception
* @see <a href="https://docs.github.com/en/rest/dependency-graph/sboms">SBOM API documentation</a>
*/
public GHSBOMExportResult getSBOM() throws IOException {
return root().createRequest()
.withUrlPath(getApiTailUrl("dependency-graph/sbom"))
.fetch(GHSBOMExportResult.class);
}

/**
* Gets size.
*
Expand Down Expand Up @@ -3397,7 +3411,7 @@ private void modifyCollaborators(@NonNull Collection<GHUser> users,
* @return the api tail url
*/
String getApiTailUrl(String tail) {
if (tail.length() > 0 && !tail.startsWith("/")) {
if (!tail.isEmpty() && !tail.startsWith("/")) {
tail = '/' + tail;
}
return "/repos/" + fullName + tail;
Expand Down
Loading
Loading