diff --git a/src/main/java/org/kohsuke/github/GHRepository.java b/src/main/java/org/kohsuke/github/GHRepository.java index 8aea5cdeb..d6dbd86f7 100644 --- a/src/main/java/org/kohsuke/github/GHRepository.java +++ b/src/main/java/org/kohsuke/github/GHRepository.java @@ -183,9 +183,18 @@ public class GHRepository { GHRelease[].class), this)); } - public List getTags() throws IOException { - return Arrays.asList(GHTag.wrap(root.retrieve().to("/repos/" + owner.login + "/" + name + "/tags", - GHTag[].class), this)); + public PagedIterable listTags() throws IOException { + return new PagedIterable() { + public PagedIterator iterator() { + return new PagedIterator(root.retrieve().asIterator(getApiTailUrl("tags"), GHTag[].class)) { + @Override + protected void wrapUp(GHTag[] page) { + for (GHTag c : page) + c.wrap(GHRepository.this); + } + }; + } + }; } protected String getOwnerName() {