From 102936b749f12a12d11a9d8d6b13aafe5897abac Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 28 Aug 2023 15:35:40 +0200 Subject: [PATCH] fix(secrets): be more forgiving when getting path --- rules/camunda-cloud/secrets.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rules/camunda-cloud/secrets.js b/rules/camunda-cloud/secrets.js index f46057a9..c3ae29d2 100644 --- a/rules/camunda-cloud/secrets.js +++ b/rules/camunda-cloud/secrets.js @@ -95,9 +95,13 @@ function validateSubscription(node) { } function getReport(propertyName, node, parentNode) { + const path = getPath(node, parentNode); + return { message: `Property <${ propertyName }> is not a valid secret`, - path: [ ...getPath(node, parentNode), propertyName ], + path: path + ? [ ...getPath(node, parentNode), propertyName ] + : [ propertyName ], data: { type: ERROR_TYPES.SECRET_EXPRESSION_INVALID, node,