feat: add support for returning YAML keys for paths that have changed (#1581)

Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
Tonye Jack
2023-09-18 14:17:46 -06:00
committed by GitHub
parent a17e8c5252
commit 5db7b578d5
6 changed files with 98 additions and 21 deletions

View File

@@ -19,7 +19,7 @@ const getArrayFromPaths = (
return Array.isArray(paths) ? paths : paths.split(inputs.separator)
}
export const setChangedFilesOutput = async ({
export const setOutputsAndGetModifiedAndChangedFilesStatus = async ({
allDiffFiles,
allFilteredDiffFiles,
inputs,
@@ -31,7 +31,7 @@ export const setChangedFilesOutput = async ({
inputs: Inputs
filePatterns?: string[]
outputPrefix?: string
}): Promise<void> => {
}): Promise<{anyModified: boolean; anyChanged: boolean}> => {
const addedFiles = await getChangeTypeFiles({
inputs,
changedFiles: allFilteredDiffFiles,
@@ -474,4 +474,9 @@ export const setChangedFilesOutput = async ({
writeOutputFiles: inputs.writeOutputFiles,
outputDir: inputs.outputDir
})
return {
anyModified: allModifiedFiles.paths.length > 0 && filePatterns.length > 0,
anyChanged: allChangedFiles.paths.length > 0 && filePatterns.length > 0
}
}