MCPcopy Index your code
hub / github.com/promptfoo/promptfoo / getPRFiles

Function getPRFiles

code-scan-action/src/github.ts:81–97  ·  view source on GitHub ↗
(
  token: string,
  context: PullRequestContext,
)

Source from the content-addressed store, hash-verified

79 * @returns Array of file changes
80 */
81export 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.

Callers 1

runCodeScanFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…