feat: add support for outputting renamed files as deleted and added (#1260)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2023-06-14 13:59:31 -06:00
committed by GitHub
parent c648759d89
commit 90ef0b1b22
9 changed files with 102 additions and 33 deletions

View File

@@ -88,18 +88,21 @@ export const getAllDiffFiles = async ({
workingDirectory,
hasSubmodule,
diffResult,
submodulePaths
submodulePaths,
outputRenamedFilesAsDeletedAndAdded
}: {
workingDirectory: string
hasSubmodule: boolean
diffResult: DiffResult
submodulePaths: string[]
outputRenamedFilesAsDeletedAndAdded: boolean
}): Promise<ChangedFiles> => {
const files = await getAllChangedFiles({
cwd: workingDirectory,
sha1: diffResult.previousSha,
sha2: diffResult.currentSha,
diff: diffResult.diff
diff: diffResult.diff,
outputRenamedFilesAsDeletedAndAdded
})
if (hasSubmodule) {
@@ -124,7 +127,8 @@ export const getAllDiffFiles = async ({
sha2: submoduleShaResult.currentSha,
diff: diffResult.diff,
isSubmodule: true,
parentDir: submodulePath
parentDir: submodulePath,
outputRenamedFilesAsDeletedAndAdded
})
for (const changeType of Object.keys(