feat: add support for recovering deleted files (#1269)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2023-06-16 18:57:12 -06:00
committed by GitHub
parent 0621d936c0
commit 77f9e6c7c6
7 changed files with 222 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
import * as core from '@actions/core'
import path from 'path'
import {getAllDiffFiles, getRenamedFiles} from './changedFiles'
import {ChangeTypeEnum, getAllDiffFiles, getRenamedFiles} from './changedFiles'
import {setChangedFilesOutput} from './changedFilesOutput'
import {
DiffResult,
@@ -14,6 +14,7 @@ import {
getSubmodulePath,
getYamlFilePatterns,
isRepoShallow,
recoverDeletedFiles,
setOutput,
submoduleExists,
updateGitGlobalConfig,
@@ -118,6 +119,13 @@ 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