( owner: string, repo: string, branch: string, path: string, env: Env, useAuth = false, )
| 303 | * @param useAuth - Whether to use authentication |
| 304 | */ |
| 305 | export async function fetchRawFile( |
| 306 | owner: string, |
| 307 | repo: string, |
| 308 | branch: string, |
| 309 | path: string, |
| 310 | env: Env, |
| 311 | useAuth = false, |
| 312 | ): Promise<string | null> { |
| 313 | const url = constructGithubUrl(owner, repo, branch, path); |
| 314 | |
| 315 | // Raw GitHub content doesn't need the GitHub API token |
| 316 | // But we still use the client for rate limiting |
| 317 | const response = await githubApiRequest(url, {}, env, 0, useAuth); |
| 318 | |
| 319 | if (!response || !response.ok) { |
| 320 | return null; |
| 321 | } |
| 322 | |
| 323 | return response.text(); |
| 324 | } |
no test coverage detected