in src/utilities/fileUtils.ts [92:135]
export async function getFilesFromDirectoriesAndURLs(
filePaths: string[]
): Promise<string[]> {
const fullPathSet: Set<string> = new Set<string>()
let fileCounter = 0
for (const fileName of filePaths) {
try {
if (isHttpUrl(fileName)) {
try {
const tempFilePath: string = await writeYamlFromURLToFile(
fileName,
fileCounter++
)
fullPathSet.add(tempFilePath)
} catch (e) {
throw Error(
`encountered error trying to pull YAML from URL ${fileName}: ${e}`
)
}
} else if (fs.lstatSync(fileName).isDirectory()) {
recurisveManifestGetter(fileName).forEach((file) => {
fullPathSet.add(file)
})
} else if (
getFileExtension(fileName) === 'yml' ||
getFileExtension(fileName) === 'yaml'
) {
fullPathSet.add(fileName)
} else {
core.debug(
`Detected non-manifest file, ${fileName}, continuing... `
)
}
} catch (ex) {
throw Error(
`Exception occurred while reading the file ${fileName}: ${ex}`
)
}
}
const arr = Array.from(fullPathSet)
return arr
}