MCPcopy Create free account
hub / github.com/remix-run/react-router / listOpenPrs

Function listOpenPrs

scripts/utils/github.ts:88–106  ·  view source on GitHub ↗
(
  options: { createdAfter?: Date; base?: string; author?: string } = {},
)

Source from the content-addressed store, hash-verified

86 * List open PRs
87 */
88export async function listOpenPrs(
89 options: { createdAfter?: Date; base?: string; author?: string } = {},
90) {
91 let response = await request("GET /repos/{owner}/{repo}/pulls", {
92 ...requestOptions(),
93 state: "open",
94 sort: "created",
95 direction: "desc",
96 per_page: 100,
97 ...(options.base ? { base: options.base } : {}),
98 });
99
100 return response.data.filter(
101 (pr) =>
102 (!options.createdAfter ||
103 new Date(pr.created_at) >= options.createdAfter) &&
104 (!options.author || pr.user?.login === options.author),
105 );
106}
107
108/**
109 * Find an open PR from a specific branch to a base branch

Callers

nothing calls this directly

Calls 2

requestOptionsFunction · 0.85
requestFunction · 0.50

Tested by

no test coverage detected