feat: move deleted file recovery to leverage filter (#1272)

This commit is contained in:
Tonye Jack
2023-06-16 20:33:42 -06:00
committed by GitHub
parent 480e87dd66
commit c3c3db7fee
5 changed files with 107 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
import * as core from '@actions/core'
import path from 'path'
import {ChangeTypeEnum, getAllDiffFiles, getRenamedFiles} from './changedFiles'
import {getAllDiffFiles, getRenamedFiles} from './changedFiles'
import {setChangedFilesOutput} from './changedFilesOutput'
import {
DiffResult,
@@ -14,7 +14,6 @@ import {
getSubmodulePath,
getYamlFilePatterns,
isRepoShallow,
recoverDeletedFiles,
setOutput,
submoduleExists,
updateGitGlobalConfig,
@@ -119,13 +118,6 @@ export async function run(): Promise<void> {
core.info('All Done!')
core.endGroup()
await recoverDeletedFiles({
inputs,
workingDirectory,
deletedFiles: allDiffFiles[ChangeTypeEnum.Deleted],
sha: diffResult.previousSha
})
const filePatterns = await getFilePatterns({
inputs,
workingDirectory
@@ -137,7 +129,9 @@ export async function run(): Promise<void> {
await setChangedFilesOutput({
allDiffFiles,
filePatterns,
inputs
inputs,
workingDirectory,
diffResult
})
core.info('All Done!')
core.endGroup()
@@ -155,8 +149,10 @@ export async function run(): Promise<void> {
await setChangedFilesOutput({
allDiffFiles,
filePatterns: yamlFilePatterns[key],
outputPrefix: key,
inputs,
outputPrefix: key
workingDirectory,
diffResult
})
core.info('All Done!')
core.endGroup()
@@ -167,7 +163,9 @@ export async function run(): Promise<void> {
core.startGroup('changed-files-all')
await setChangedFilesOutput({
allDiffFiles,
inputs
inputs,
workingDirectory,
diffResult
})
core.info('All Done!')
core.endGroup()