diff --git a/lib/constants.js b/lib/constants.js index 79b1ba1c..e3ec892e 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -26,7 +26,7 @@ exports.deploymentTypes = ['deployment', 'replicaset', 'daemonset', 'pod', 'stat exports.workloadTypes = ['deployment', 'replicaset', 'daemonset', 'pod', 'statefulset', 'job', 'cronjob']; exports.workloadTypesWithRolloutStatus = ['deployment', 'daemonset', 'statefulset']; function getWorkflowAnnotationsJson(lastSuccessRunSha, workflowFilePath, filePathConfigs) { - return `{` + return JSON.stringify(`{` + `'run': '${process.env.GITHUB_RUN_ID}',` + `'repository': '${process.env.GITHUB_REPOSITORY}',` + `'workflow': '${process.env.GITHUB_WORKFLOW}',` @@ -41,7 +41,7 @@ function getWorkflowAnnotationsJson(lastSuccessRunSha, workflowFilePath, filePat + `'manifestsPaths': '${filePathConfigs.manifestFilePaths}',` + `'dockerfilePaths': '${filePathConfigs.buildConfigs}',` + `'provider': 'GitHub'` - + `}`; + + `}`); } exports.getWorkflowAnnotationsJson = getWorkflowAnnotationsJson; function getWorkflowAnnotationKeyLabel(workflowFilePath) { diff --git a/src/constants.ts b/src/constants.ts index 69102383..836e6fdb 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -26,7 +26,7 @@ export const workloadTypes: string[] = ['deployment', 'replicaset', 'daemonset', export const workloadTypesWithRolloutStatus: string[] = ['deployment', 'daemonset', 'statefulset']; export function getWorkflowAnnotationsJson(lastSuccessRunSha: string, workflowFilePath: string, filePathConfigs: any): string { - return `{` + return JSON.stringify(`{` + `'run': '${process.env.GITHUB_RUN_ID}',` + `'repository': '${process.env.GITHUB_REPOSITORY}',` + `'workflow': '${process.env.GITHUB_WORKFLOW}',` @@ -41,7 +41,7 @@ export function getWorkflowAnnotationsJson(lastSuccessRunSha: string, workflowFi + `'manifestsPaths': '${filePathConfigs.manifestFilePaths}',` + `'dockerfilePaths': '${filePathConfigs.buildConfigs}',` + `'provider': 'GitHub'` - + `}`; + + `}`); } export function getWorkflowAnnotationKeyLabel(workflowFilePath: string): string {