export async function getDeploymentConfig()

in src/utilities/dockerUtils.ts [7:52]


export async function getDeploymentConfig(): Promise<DeploymentConfig> {
   let helmChartPaths: string[] =
      process.env?.HELM_CHART_PATHS?.split(';').filter((path) => path != '') ||
      []
   helmChartPaths = helmChartPaths.map((helmchart) =>
      getNormalizedPath(helmchart.trim())
   )

   let inputManifestFiles: string[] =
      core
         .getInput('manifests')
         .split(/[\n,;]+/)
         .filter((manifest) => manifest.trim().length > 0) || []
   if (helmChartPaths?.length == 0) {
      inputManifestFiles = inputManifestFiles.map((manifestFile) =>
         getNormalizedPath(manifestFile)
      )
   }

   const imageNames =
      core
         .getInput('images')
         .split('\n')
         .filter((image) => image.length > 0) || []
   const imageDockerfilePathMap: {[id: string]: string} = {}

   const pullImages = !(core.getInput('pull-images').toLowerCase() === 'false')
   if (pullImages) {
      //Fetching from image label if available
      for (const image of imageNames) {
         try {
            imageDockerfilePathMap[image] = await getDockerfilePath(image)
         } catch (ex) {
            core.warning(
               `Failed to get dockerfile path for image ${image.toString()}: ${ex} `
            )
         }
      }
   }

   return Promise.resolve(<DeploymentConfig>{
      manifestFilePaths: inputManifestFiles,
      helmChartFilePaths: helmChartPaths,
      dockerfilePaths: imageDockerfilePathMap
   })
}