diff --git a/lib/constants.js b/lib/constants.js index f2ac7369..2bfa414c 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.helmChartFilePaths)}',` + + `'dockerfilePaths': '${JSON.stringify(filePathConfigs.dockerfilePaths, null, 2)}',` + + `'manifestsPaths': '${JSON.stringify(filePathConfigs.manifestFilePaths, null, 2)}',` + + `'helmChartPaths': '${JSON.stringify(filePathConfigs.helmChartFilePaths, null, 2)}',` + `'provider': 'GitHub'` + `}`; } diff --git a/lib/utilities/utility.js b/lib/utilities/utility.js index 3b4904fd..e4a4ed0d 100644 --- a/lib/utilities/utility.js +++ b/lib/utilities/utility.js @@ -148,8 +148,12 @@ function getFilePathsConfigs() { const DOCKERFILE_PATH_LABEL_KEY = 'dockerfile-path'; let inputManifestFiles = inputParams.manifests || []; filePathsConfig[MANIFEST_PATHS_KEY] = inputManifestFiles; - let helmChartPaths = process.env.HELM_CHART_PATHS || ''; - filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n'); + let helmChartPaths = []; + if (process.env.HELM_CHART_PATHS) { + helmChartPaths = process.env.HELM_CHART_PATHS.split('\n'); + helmChartPaths.filter(val => val != ""); + } + filePathsConfig[HELM_CHART_KEY] = helmChartPaths; //Fetch labels from each image let imageNames = core.getInput('images').split('\n'); let imageDockerfilePathList = []; diff --git a/src/constants.ts b/src/constants.ts index d215fd3a..f7da49e2 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.helmChartFilePaths)}',` + + `'dockerfilePaths': '${JSON.stringify(filePathConfigs.dockerfilePaths,null,2)}',` + + `'manifestsPaths': '${JSON.stringify(filePathConfigs.manifestFilePaths,null,2)}',` + + `'helmChartPaths': '${JSON.stringify(filePathConfigs.helmChartFilePaths,null,2)}',` + `'provider': 'GitHub'` + `}`; } diff --git a/src/utilities/utility.ts b/src/utilities/utility.ts index 80835675..018cf646 100644 --- a/src/utilities/utility.ts +++ b/src/utilities/utility.ts @@ -6,6 +6,7 @@ import { GitHubClient } from '../githubClient'; import { StatusCodes } from "./httpClient"; import * as exec from "./exec"; import * as inputParams from "../input-parameters"; +import { Z_FILTERED } from 'zlib'; export function getExecutableExtension(): string { if (os.type().match(/^Win/)) { @@ -140,8 +141,13 @@ export async function getFilePathsConfigs(): Promise { let inputManifestFiles = inputParams.manifests || []; filePathsConfig[MANIFEST_PATHS_KEY] = inputManifestFiles; - let helmChartPaths = process.env.HELM_CHART_PATHS || ''; - filePathsConfig[HELM_CHART_KEY] = helmChartPaths.split('\n'); + let helmChartPaths = []; + if(process.env.HELM_CHART_PATHS){ + helmChartPaths = process.env.HELM_CHART_PATHS.split('\n'); + helmChartPaths.filter( val => val != "" ); + } + + filePathsConfig[HELM_CHART_KEY] = helmChartPaths; //Fetch labels from each image