MCPcopy
hub / github.com/PrismJS/prism / getChangedFiles

Function getChangedFiles

dangerfile.js:32–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 * @returns {Promise<string[]>}
31 */
32const getChangedFiles = async () => {
33 // Determine the merge base between master and the PR branch.
34 // If files changed in master since PR was branched they would show in the diff otherwise.
35 // https://stackoverflow.com/questions/25071579/list-all-files-changed-in-a-pull-request-in-git-github
36 const mergeBase = (await git.raw(['merge-base', 'pr', 'HEAD'])).trim();
37 const result = await git.diff(['--name-only', '--no-renames', 'pr', mergeBase]);
38 return (result || '').trim().split(/\r?\n/g);
39};
40
41const getChangedMinifiedFiles = async () => {
42 const changed = await getChangedFiles();

Callers 1

getChangedMinifiedFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected