Skip to content

Commit 49c623e

Browse files
committed
handlebar defaultContext support for build-contexts input
Signed-off-by: CrazyMax <[email protected]>
1 parent bcc9f4a commit 49c623e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/context.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,12 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
132132
});
133133
if (await toolkit.buildx.versionSatisfies('>=0.8.0')) {
134134
await Util.asyncForEach(inputs['build-contexts'], async buildContext => {
135-
args.push('--build-context', buildContext);
135+
args.push(
136+
'--build-context',
137+
handlebars.compile(buildContext)({
138+
defaultContext: Context.gitContext()
139+
})
140+
);
136141
});
137142
} else if (inputs['build-contexts'].length > 0) {
138143
core.warning("Build contexts are only supported by buildx >= 0.8.0; the input 'build-contexts' is ignored.");

0 commit comments

Comments
 (0)