Skip to content

Commit

Permalink
Merge pull request #1283 from crazy-max/named-context-handlebars
Browse files Browse the repository at this point in the history
handlebar defaultContext support for build-contexts input
  • Loading branch information
crazy-max authored Jan 8, 2025
2 parents 7e09459 + d1a4129 commit 128779f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 128779f

Please sign in to comment.