function appendStableVersionLabelToResource()

in src/strategyHelpers/deploymentHelper.ts [109:138]


function appendStableVersionLabelToResource(files: string[]): string[] {
   const manifestFiles = []
   const newObjectsList = []

   files.forEach((filePath: string) => {
      try {
         const fileContents = fs.readFileSync(filePath).toString()

         yaml.loadAll(fileContents, function (inputObject) {
            const kind = (inputObject as {kind: string}).kind

            if (isDeploymentEntity(kind)) {
               const updatedObject =
                  canaryDeploymentHelper.markResourceAsStable(inputObject)
               newObjectsList.push(updatedObject)
            } else {
               manifestFiles.push(filePath)
            }
         })
      } catch (error) {
         core.error(`Failed to parse file at ${filePath}: ${error.message}`)
         throw error
      }
   })

   const updatedManifestFiles = fileHelper.writeObjectsToFile(newObjectsList)
   manifestFiles.push(...updatedManifestFiles)

   return manifestFiles
}