Skip to content

Commit 29df631

Browse files
committed
build/bake: enable fetch-by-commit for generated git contexts
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent 589aff6 commit 29df631

4 files changed

Lines changed: 3 additions & 7 deletions

File tree

.github/workflows/bake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ jobs:
414414
return;
415415
}
416416
417-
const bakeSource = await new Build().gitContext({subdir: inpContext});
417+
const bakeSource = await new Build().gitContext({subdir: inpContext, attrs: {'fetch-by-commit': 'true'}});
418418
await core.group(`Set bake source`, async () => {
419419
core.info(bakeSource);
420420
});
@@ -810,7 +810,7 @@ jobs:
810810
};
811811
const renderTemplate = value => Util.compileHandlebars(value, {noEscape: true}, {meta});
812812
813-
const bakeSource = await new Build().gitContext({subdir: inpContext});
813+
const bakeSource = await new Build().gitContext({subdir: inpContext, attrs: {'fetch-by-commit': 'true'}});
814814
await core.group(`Set source output`, async () => {
815815
core.info(bakeSource);
816816
core.setOutput('source', bakeSource);

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ jobs:
704704
const renderTemplate = value => Util.compileHandlebars(value, {noEscape: true}, {meta});
705705
const toMultilineInput = value => value.split(/\r?\n/).map(line => line.trim()).filter(Boolean);
706706
707-
const buildContext = await new Build().gitContext({subdir: inpContext});
707+
const buildContext = await new Build().gitContext({subdir: inpContext, attrs: {'fetch-by-commit': 'true'}});
708708
core.setOutput('context', buildContext);
709709
710710
switch (inpOutput) {

test/go.Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# syntax=docker/dockerfile:1
2-
31
ARG GO_VERSION="1.25"
42
ARG XX_VERSION="1.7.0"
53

test/hello.Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# syntax=docker/dockerfile:1
2-
31
FROM alpine AS base
42
ARG TARGETPLATFORM
53
ARG VERSION="unknown"

0 commit comments

Comments
 (0)