(url: string, init?: RequestInit)
| 360 | } |
| 361 | |
| 362 | async function githubRequest(url: string, init?: RequestInit): Promise<Response> { |
| 363 | const token = getGithubTokenOrThrow(); |
| 364 | return fetchWithBackoff( |
| 365 | url, |
| 366 | { |
| 367 | ...init, |
| 368 | headers: { |
| 369 | Accept: 'application/vnd.github+json', |
| 370 | Authorization: `Bearer ${token}`, |
| 371 | 'X-GitHub-Api-Version': '2022-11-28', |
| 372 | ...(init?.headers ?? {}), |
| 373 | }, |
| 374 | }, |
| 375 | { |
| 376 | retryResponse: r => r.status === 429 || r.status >= 500, |
| 377 | maxDelayMs: 10_000, |
| 378 | } |
| 379 | ); |
| 380 | } |
| 381 | |
| 382 | async function listOpenPullRequestAuthors(options: { |
| 383 | repo: RepoRef; |
no test coverage detected