Skip to content

Commit 040326d

Browse files
committed
build/bake: switch to compileHandlebars helper
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent 2a93663 commit 040326d

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

.github/workflows/bake.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ env:
159159
SBOM_IMAGE: "docker/buildkit-syft-scanner:1.11.0"
160160
BINFMT_IMAGE: "tonistiigi/binfmt:qemu-v10.2.1-65"
161161
DOCKER_ACTIONS_TOOLKIT_MODULE: "@docker/actions-toolkit@0.89.0"
162-
HANDLEBARS_MODULE: "handlebars@4.7.9"
163162
COSIGN_VERSION: "v3.0.6"
164163
LOCAL_EXPORT_DIR: "/tmp/buildx-output"
165164
MATRIX_SIZE_LIMIT: "20"
@@ -487,15 +486,13 @@ jobs:
487486
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
488487
env:
489488
INPUT_DAT-MODULE: ${{ env.DOCKER_ACTIONS_TOOLKIT_MODULE }}
490-
INPUT_HANDLEBARS-MODULE: ${{ env.HANDLEBARS_MODULE }}
491489
with:
492490
script: |
493491
await exec.exec('npm', [
494492
'install',
495493
'--prefer-offline',
496494
'--ignore-scripts',
497-
core.getInput('dat-module'),
498-
core.getInput('handlebars-module')
495+
core.getInput('dat-module')
499496
]);
500497
-
501498
name: Docker meta
@@ -653,7 +650,6 @@ jobs:
653650
with:
654651
script: |
655652
const os = require('os');
656-
const Handlebars = require('handlebars');
657653
const { Build } = require('@docker/actions-toolkit/lib/buildx/build');
658654
const { GitHub } = require('@docker/actions-toolkit/lib/github/github');
659655
const { Util } = require('@docker/actions-toolkit/lib/util');
@@ -690,7 +686,7 @@ jobs:
690686
version: inpMetaVersion,
691687
tags: inpMetaTags
692688
};
693-
const renderTemplate = value => Handlebars.compile(value, {noEscape: true})({meta});
689+
const renderTemplate = value => Util.compileHandlebars(value, {noEscape: true}, {meta});
694690
695691
const bakeSource = await new Build().gitContext({subdir: inpContext});
696692
await core.group(`Set source output`, async () => {

.github/workflows/build.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ env:
162162
SBOM_IMAGE: "docker/buildkit-syft-scanner:1.11.0"
163163
BINFMT_IMAGE: "tonistiigi/binfmt:qemu-v10.2.1-65"
164164
DOCKER_ACTIONS_TOOLKIT_MODULE: "@docker/actions-toolkit@0.89.0"
165-
HANDLEBARS_MODULE: "handlebars@4.7.9"
166165
COSIGN_VERSION: "v3.0.6"
167166
LOCAL_EXPORT_DIR: "/tmp/buildx-output"
168167
MATRIX_SIZE_LIMIT: "20"
@@ -380,15 +379,13 @@ jobs:
380379
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
381380
env:
382381
INPUT_DAT-MODULE: ${{ env.DOCKER_ACTIONS_TOOLKIT_MODULE }}
383-
INPUT_HANDLEBARS-MODULE: ${{ env.HANDLEBARS_MODULE }}
384382
with:
385383
script: |
386384
await exec.exec('npm', [
387385
'install',
388386
'--prefer-offline',
389387
'--ignore-scripts',
390-
core.getInput('dat-module'),
391-
core.getInput('handlebars-module')
388+
core.getInput('dat-module')
392389
]);
393390
-
394391
name: Docker meta
@@ -546,7 +543,7 @@ jobs:
546543
script: |
547544
const { Build } = require('@docker/actions-toolkit/lib/buildx/build');
548545
const { GitHub } = require('@docker/actions-toolkit/lib/github/github');
549-
const Handlebars = require('handlebars');
546+
const { Util } = require('@docker/actions-toolkit/lib/util');
550547
551548
const inpPlatform = core.getInput('platform');
552549
const platformPairSuffix = inpPlatform ? `-${inpPlatform.replace(/\//g, '-')}` : '';
@@ -582,7 +579,7 @@ jobs:
582579
tags: inpMetaTags
583580
};
584581
585-
const renderTemplate = value => Handlebars.compile(value, {noEscape: true})({meta});
582+
const renderTemplate = value => Util.compileHandlebars(value, {noEscape: true}, {meta});
586583
const toMultilineInput = value => value.split(/\r?\n/).map(line => line.trim()).filter(Boolean);
587584
588585
const buildContext = await new Build().gitContext({subdir: inpContext});

0 commit comments

Comments
 (0)