(path: string)
| 52 | } |
| 53 | |
| 54 | async function ghFetch(path: string): Promise<Response> { |
| 55 | const headers: Record<string, string> = { |
| 56 | 'Accept': 'application/vnd.github+json', |
| 57 | 'X-GitHub-Api-Version': '2022-11-28', |
| 58 | }; |
| 59 | if (process.env.GITHUB_TOKEN) headers['Authorization'] = `Bearer ${process.env.GITHUB_TOKEN}`; |
| 60 | return fetch(`${GH_API}${path}`, { headers, signal: AbortSignal.timeout(10_000) }); |
| 61 | } |
| 62 | |
| 63 | async function resolveVersion(channel: Channel): Promise<string> { |
| 64 | if (channel !== 'stable' && channel !== 'latest') { |
no test coverage detected