[FEAT]: Octokit::Client::PullRequests#pull_requests should accept a block. #1508
Labels
Status: Up for grabs
Issues that are ready to be worked on by anyone
Type: Feature
New feature or request
Describe the need
It is nice to use auto_paginate, but sometimes it is nice to also interrupt pagination when I have found the results I'm looking for.
It looks like
paginate
accepts a block, butpull_requests
does not. It would be nice to be able to pass a block topull_requests
in order to process each page as it is fetched and, further, so that pagination may be interrupted with an exception if desired.The current alternatives are:
pull_requests
with auto_paginate and assume the time cost of receiving every page of resultsExample use case: I want all PRs merged after a given time. Best I can tell, the github pull_requests api doesn't allow this granularity, so one search pull requests by date and then stop paginating once we find the first pull that's older than the requested time.
SDK Version
No response
API Version
No response
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: