diff --git a/core/src/resolve-module.ts b/core/src/resolve-module.ts index 13f414b5ce..ae27f69a22 100644 --- a/core/src/resolve-module.ts +++ b/core/src/resolve-module.ts @@ -659,6 +659,11 @@ export class ModuleResolver { context: configContext, contextOpts: { allowPartial: false, + // Modules will be converted to actions later, and the actions will be properly unescaped. + // We avoid premature un-escaping here, + // because otherwise it will strip the escaped value in the module config + // to the normal template string in the converted action config. + unescape: false, }, // Note: We're not implementing the YAML source mapping for modules source: undefined, diff --git a/core/src/template-string/template-string.ts b/core/src/template-string/template-string.ts index ae5d8ccb91..91524dbb92 100644 --- a/core/src/template-string/template-string.ts +++ b/core/src/template-string/template-string.ts @@ -120,6 +120,15 @@ export const resolveTemplateString = profile(function resolveTemplateString({ return string } + const shouldUnescape = (ctxOpts: ContextResolveOpts) => { + // Explicit non-escaping takes the highest priority. + if (ctxOpts.unescape === false) { + return false + } + + return !!ctxOpts.unescape || !contextOpts.allowPartial + } + try { const parsed = parser.parse(string, { getKey: (key: string[], resolveOpts?: ContextResolveOpts) => { @@ -135,7 +144,7 @@ export const resolveTemplateString = profile(function resolveTemplateString({ missingKeyExceptionType, passthroughExceptionType, allowPartial: !!contextOpts.allowPartial, - unescape: !!contextOpts.unescape || !contextOpts.allowPartial, + unescape: shouldUnescape(contextOpts), escapePrefix, optionalSuffix: "}?", isPlainObject,