github.listPullRequests filters by branch and state and supports sorting and pagination.
automations/list-github-pull-requests.automation.ts
owner and repository. Optional filters are base, head, state, sort, and direction. For forks, format head as owner:branch. state accepts "open", "closed", or "all" and defaults to "open". sort accepts "created", "updated", "popularity", or "long-running". page defaults to 1 and perPage defaults to 30 with a maximum of 100. Optional second argument { account } defaults to the project binding. Inputs accept compatible signals.
Returns an array with each pull request’s id, number, title, and head ref and sha. Request another page while the returned page length equals perPage.