From 49c623eaf82513814393adabc13bf2535384d735 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:26:12 +0100 Subject: [PATCH] handlebar defaultContext support for build-contexts input Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- src/context.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/context.ts b/src/context.ts index abc3596..0a110a2 100644 --- a/src/context.ts +++ b/src/context.ts @@ -132,7 +132,12 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit): }); if (await toolkit.buildx.versionSatisfies('>=0.8.0')) { await Util.asyncForEach(inputs['build-contexts'], async buildContext => { - args.push('--build-context', buildContext); + args.push( + '--build-context', + handlebars.compile(buildContext)({ + defaultContext: Context.gitContext() + }) + ); }); } else if (inputs['build-contexts'].length > 0) { core.warning("Build contexts are only supported by buildx >= 0.8.0; the input 'build-contexts' is ignored.");