( owner: string, repo: string, branch: string, headers: Record<string, string> )
| 162 | } |
| 163 | |
| 164 | async function fetchRepoTree( |
| 165 | owner: string, |
| 166 | repo: string, |
| 167 | branch: string, |
| 168 | headers: Record<string, string> |
| 169 | ): Promise<GitHubTreeResponse | { error: string }> { |
| 170 | const treeUrl = `${GITHUB_API}/repos/${owner}/${repo}/git/trees/${branch}?recursive=1`; |
| 171 | const response = await fetch(treeUrl, { headers }); |
| 172 | if (!response.ok) return { error: await extractGitHubError(response) }; |
| 173 | return (await response.json()) as GitHubTreeResponse; |
| 174 | } |
| 175 | |
| 176 | async function fetchDefaultBranch( |
| 177 | owner: string, |
no test coverage detected