in src/utilities/manifestUpdateUtils.ts [306:332]
function updateImagePullSecretsInManifestFiles(
filePaths: string[],
imagePullSecrets: string[]
): string[] {
if (imagePullSecrets?.length <= 0) return filePaths
const newObjectsList = []
filePaths.forEach((filePath: string) => {
try {
const fileContents = fs.readFileSync(filePath).toString()
yaml.loadAll(fileContents, (inputObject: any) => {
if (inputObject?.kind) {
const {kind} = inputObject
if (isWorkloadEntity(kind)) {
updateImagePullSecrets(inputObject, imagePullSecrets)
}
newObjectsList.push(inputObject)
}
})
} catch (error) {
core.error(`Failed to process file at ${filePath}: ${error.message}`)
throw error
}
})
return fileHelper.writeObjectsToFile(newObjectsList)
}