diff --git a/lib/constants.js b/lib/constants.js index 002af11d..adbf124f 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -38,9 +38,9 @@ function getWorkflowAnnotationsJson(lastSuccessRunSha, workflowFilePath, filePat + `'lastSuccessRunCommit': '${lastSuccessRunSha}',` + `'branch': '${process.env.GITHUB_REF}',` + `'deployTimestamp': '${Date.now()}',` - + `'dockerfilePaths': ${JSON.stringify(filePathConfigs.dockerfilePaths)},` - + `'manifestsPaths': ${JSON.stringify(filePathConfigs.manifestFilePaths)},` - + `'helmChartPaths': ${JSON.stringify(filePathConfigs.helmChartPaths)},` + + `'dockerfilePaths': '${filePathConfigs.dockerfilePaths}',` + + `'manifestsPaths': '${filePathConfigs.manifestFilePaths}',` + + `'helmChartPaths': '${filePathConfigs.helmChartPaths}',` + `'provider': 'GitHub'` + `}`; } diff --git a/lib/utilities/utility.js b/lib/utilities/utility.js index 0dccee26..193b4342 100644 --- a/lib/utilities/utility.js +++ b/lib/utilities/utility.js @@ -149,7 +149,7 @@ function getFilePathsConfigs() { let inputManifestFiles = inputParams.manifests || []; filePathsConfig[MANIFEST_PATHS_KEY] = inputManifestFiles; let helmChartPaths = process.env.HELM_CHART_PATHS || ''; - filePathsConfig[HELM_CHART_KEY] = helmChartPaths; + filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n'); //Fetch labels from each image let imageToBuildConfigMap = []; let imageNames = core.getInput('images').split('\n'); @@ -190,6 +190,9 @@ function getFilePathsConfigs() { if ((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])) { imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY]; } + else { + imageToBuildConfigMap[image] = 'Not available'; + } } } filePathsConfig[DOCKERFILE_PATH_KEY] = imageToBuildConfigMap; diff --git a/src/constants.ts b/src/constants.ts index 67fd42f0..505b371e 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -38,9 +38,9 @@ export function getWorkflowAnnotationsJson(lastSuccessRunSha: string, workflowFi + `'lastSuccessRunCommit': '${lastSuccessRunSha}',` + `'branch': '${process.env.GITHUB_REF}',` + `'deployTimestamp': '${Date.now()}',` - + `'dockerfilePaths': ${JSON.stringify(filePathConfigs.dockerfilePaths)},` - + `'manifestsPaths': ${JSON.stringify(filePathConfigs.manifestFilePaths)},` - + `'helmChartPaths': ${JSON.stringify(filePathConfigs.helmChartPaths)},` + + `'dockerfilePaths': '${filePathConfigs.dockerfilePaths}',` + + `'manifestsPaths': '${filePathConfigs.manifestFilePaths}',` + + `'helmChartPaths': '${filePathConfigs.helmChartPaths}',` + `'provider': 'GitHub'` + `}`; } diff --git a/src/utilities/utility.ts b/src/utilities/utility.ts index 496bea54..5e42d88f 100644 --- a/src/utilities/utility.ts +++ b/src/utilities/utility.ts @@ -141,7 +141,7 @@ export async function getFilePathsConfigs(): Promise { filePathsConfig[MANIFEST_PATHS_KEY] = inputManifestFiles; let helmChartPaths = process.env.HELM_CHART_PATHS || ''; - filePathsConfig[HELM_CHART_KEY] = helmChartPaths; + filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n'); //Fetch labels from each image let imageToBuildConfigMap: any = []; @@ -190,6 +190,9 @@ export async function getFilePathsConfigs(): Promise { if((resultObj.Config) && (resultObj.Config.Labels) && (resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY])){ imageToBuildConfigMap[image] = resultObj.Config.Labels[DOCKERFILE_PATH_LABEL_KEY]; } + else{ + imageToBuildConfigMap[image] = 'Not available'; + } } }