forked from ziishaned/jest-reporter-action
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check which files were changed in pr
- Loading branch information
Showing
4 changed files
with
104 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export async function changedFiles(github, repo, commits) { | ||
const files = [] | ||
|
||
await Promise.all( | ||
commits.map(async function(commit) { | ||
if (!commit.distinct) { | ||
return | ||
} | ||
|
||
const result = await github.repos.getCommit({ | ||
...repo, | ||
ref: commit.id, | ||
}) | ||
|
||
if (!result || !result.data) { | ||
return | ||
} | ||
|
||
for (const file of result.data.files) { | ||
if (file.status === "added" || file.status === "modified") { | ||
files.push(file.filename) | ||
} | ||
} | ||
}), | ||
) | ||
|
||
return files | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters