Skip to content

Commit 128779f

Browse files
authored
Merge pull request #1283 from crazy-max/named-context-handlebars
handlebar defaultContext support for build-contexts input
2 parents 7e09459 + d1a4129 commit 128779f

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)