Skip to content
Merged
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
8 changes: 8 additions & 0 deletions src/main/java/org/kohsuke/github/GitHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,14 @@ public GHRepository getRepository(String name) throws IOException {
String[] tokens = name.split("/");
return retrieve().to("/repos/" + tokens[0] + '/' + tokens[1], GHRepository.class).wrap(this);
}

/**
* Gets the repository object from its ID
*/
public GHRepository getRepositoryById(String id) throws IOException {
return retrieve().to("/repositories/" + id, GHRepository.class).wrap(this);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesatha Is there this endpoint documented? I was not able to find it here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Officially no. But it is supported. The issue filed gives a bit more info about it's "documentation" and how other clients support it: #515

}

/**
* Returns a list of popular open source licenses
*
Expand Down