@@ -1189,11 +1189,7 @@ public Map<String, GHBranch> getBranches() throws IOException {
11891189 * for a specific ref</a>
11901190 */
11911191 public PagedIterable <GHCheckRun > getCheckRuns (String ref ) {
1192- GitHubRequest request = root ().createRequest ()
1193- .withUrlPath (String .format ("/repos/%s/%s/commits/%s/check-runs" , getOwnerName (), name , ref ))
1194- .build ();
1195- return new PagedIterable <>(new PaginatedEndpoint <>(root ()
1196- .getClient (), request , GHCheckRunsPage .class , GHCheckRun .class , item -> item .wrap (this )));
1192+ return getCheckRuns (ref , null );
11971193 }
11981194
11991195 /**
@@ -1208,12 +1204,10 @@ public PagedIterable<GHCheckRun> getCheckRuns(String ref) {
12081204 * for a specific ref</a>
12091205 */
12101206 public PagedIterable <GHCheckRun > getCheckRuns (String ref , Map <String , Object > params ) {
1211- GitHubRequest request = root ().createRequest ()
1207+ Requester requester = root ().createRequest ()
12121208 .withUrlPath (String .format ("/repos/%s/%s/commits/%s/check-runs" , getOwnerName (), name , ref ))
1213- .with (params )
1214- .build ();
1215- return new PagedIterable <>(new PaginatedEndpoint <>(root ()
1216- .getClient (), request , GHCheckRunsPage .class , GHCheckRun .class , item -> item .wrap (this )));
1209+ .with (params );
1210+ return requester .toIterable (GHCheckRunsPage .class , GHCheckRun .class , item -> item .wrap (this ));
12171211 }
12181212
12191213 /**
@@ -2554,11 +2548,9 @@ public boolean isVulnerabilityAlertsEnabled() throws IOException {
25542548 * @return the paged iterable
25552549 */
25562550 public PagedIterable <GHArtifact > listArtifacts () {
2557- return new PagedIterable <>(new PaginatedEndpoint <>(this .root ().getClient (),
2558- root ().createRequest ().withUrlPath (getApiTailUrl ("actions/artifacts" )).build (),
2559- GHArtifactsPage .class ,
2560- GHArtifact .class ,
2561- item -> item .wrapUp (this )));
2551+ return root ().createRequest ()
2552+ .withUrlPath (getApiTailUrl ("actions/artifacts" ))
2553+ .toIterable (GHArtifactsPage .class , GHArtifact .class , item -> item .wrapUp (this ));
25622554 }
25632555
25642556 /**
@@ -2966,11 +2958,9 @@ public List<String> listTopics() throws IOException {
29662958 * @return the paged iterable
29672959 */
29682960 public PagedIterable <GHWorkflow > listWorkflows () {
2969- return new PagedIterable <>(new PaginatedEndpoint <>(root ().getClient (),
2970- root ().createRequest ().withUrlPath (getApiTailUrl ("actions/workflows" )).build (),
2971- GHWorkflowsPage .class ,
2972- GHWorkflow .class ,
2973- item -> item .wrapUp (this )));
2961+ return root ().createRequest ()
2962+ .withUrlPath (getApiTailUrl ("actions/workflows" ))
2963+ .toIterable (GHWorkflowsPage .class , GHWorkflow .class , item -> item .wrapUp (this ));
29742964 }
29752965
29762966 /**
0 commit comments