(
options: { createdAfter?: Date; base?: string; author?: string } = {},
)
| 86 | * List open PRs |
| 87 | */ |
| 88 | export 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 |
nothing calls this directly
no test coverage detected