diff --git a/src/main/java/org/kohsuke/github/GitHub.java b/src/main/java/org/kohsuke/github/GitHub.java index 84bd1cb93..706a9112d 100644 --- a/src/main/java/org/kohsuke/github/GitHub.java +++ b/src/main/java/org/kohsuke/github/GitHub.java @@ -97,6 +97,9 @@ public class GitHub { return MAPPER.readValue(getApiURL(tail),type); } + /** + * Obtains the object that represents the named user. + */ public GHUser getUser(String login) throws IOException { GHUser u = users.get(login); if (u==null) { @@ -107,6 +110,14 @@ public class GitHub { return u; } + /** + * Gets the {@link GHUser} that represents yourself. + */ + public GHUser getMyself() throws IOException { + requireCredential(); + return getUser(login); + } + /** * Creates a new repository. *