( token: string, context: PullRequestContext, )
| 79 | * @returns Array of file changes |
| 80 | */ |
| 81 | export async function getPRFiles( |
| 82 | token: string, |
| 83 | context: PullRequestContext, |
| 84 | ): Promise<FileChange[]> { |
| 85 | const octokit = new Octokit({ auth: token }); |
| 86 | |
| 87 | const { data: files } = await octokit.pulls.listFiles({ |
| 88 | owner: context.owner, |
| 89 | repo: context.repo, |
| 90 | pull_number: context.number, |
| 91 | }); |
| 92 | |
| 93 | return files.map((file) => ({ |
| 94 | path: file.filename, |
| 95 | status: file.status as FileChangeStatus, |
| 96 | })); |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Fetch PR diff and extract valid line ranges for each file. |
no outgoing calls
no test coverage detected
searching dependent graphs…