mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-23 13:09:27 +08:00
prefix for annotations (#191)
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
import { DeploymentConfig } from "../types/deploymentConfig";
|
||||
|
||||
const ANNOTATION_PREFIX = "actions.github.com/";
|
||||
|
||||
export function prefixObjectKeys(obj: any, prefix: string): any {
|
||||
return Object.keys(obj).reduce((newObj, key) => {
|
||||
newObj[prefix + key] = obj[key];
|
||||
return newObj;
|
||||
}, {});
|
||||
}
|
||||
|
||||
export function getWorkflowAnnotations(
|
||||
lastSuccessRunSha: string,
|
||||
workflowFilePath: string,
|
||||
@@ -22,7 +31,8 @@ export function getWorkflowAnnotations(
|
||||
helmChartPaths: deploymentConfig.helmChartFilePaths,
|
||||
provider: "GitHub",
|
||||
};
|
||||
return JSON.stringify(annotationObject);
|
||||
const prefixedAnnotationObject = prefixObjectKeys(annotationObject, ANNOTATION_PREFIX);
|
||||
return JSON.stringify(prefixedAnnotationObject);
|
||||
}
|
||||
|
||||
export function getWorkflowAnnotationKeyLabel(
|
||||
|
||||
Reference in New Issue
Block a user