From a3bfca795707a0276fd9509e1e520cf147883e59 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Wed, 18 Mar 2026 09:39:17 +0100 Subject: [PATCH 1/3] update actions-toolkit to 0.84.1 Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- .github/workflows/bake.yml | 2 +- .github/workflows/build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bake.yml b/.github/workflows/bake.yml index ba2ca7e..455bdf4 100644 --- a/.github/workflows/bake.yml +++ b/.github/workflows/bake.yml @@ -153,7 +153,7 @@ env: BUILDKIT_IMAGE: "moby/buildkit:v0.28.0" SBOM_IMAGE: "docker/buildkit-syft-scanner:1.10.0" BINFMT_IMAGE: "tonistiigi/binfmt:qemu-v10.2.1-65" - DOCKER_ACTIONS_TOOLKIT_MODULE: "@docker/actions-toolkit@0.83.0" + DOCKER_ACTIONS_TOOLKIT_MODULE: "@docker/actions-toolkit@0.84.1" HANDLEBARS_MODULE: "handlebars@4.7.8" COSIGN_VERSION: "v3.0.2" LOCAL_EXPORT_DIR: "/tmp/buildx-output" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d4ff39..be1e5c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -156,7 +156,7 @@ env: BUILDKIT_IMAGE: "moby/buildkit:v0.28.0" SBOM_IMAGE: "docker/buildkit-syft-scanner:1.10.0" BINFMT_IMAGE: "tonistiigi/binfmt:qemu-v10.2.1-65" - DOCKER_ACTIONS_TOOLKIT_MODULE: "@docker/actions-toolkit@0.83.0" + DOCKER_ACTIONS_TOOLKIT_MODULE: "@docker/actions-toolkit@0.84.1" HANDLEBARS_MODULE: "handlebars@4.7.8" COSIGN_VERSION: "v3.0.2" LOCAL_EXPORT_DIR: "/tmp/buildx-output" From f5167f11f2081c77c960f12acec85eb0d4cdc5df Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Wed, 18 Mar 2026 09:38:32 +0100 Subject: [PATCH 2/3] build/bake: use query format for git context Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- .github/workflows/bake.yml | 14 ++++++++++++-- .github/workflows/build.yml | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bake.yml b/.github/workflows/bake.yml index 455bdf4..ab54a57 100644 --- a/.github/workflows/bake.yml +++ b/.github/workflows/bake.yml @@ -158,6 +158,7 @@ env: COSIGN_VERSION: "v3.0.2" LOCAL_EXPORT_DIR: "/tmp/buildx-output" MATRIX_SIZE_LIMIT: "20" + BUILDX_SEND_GIT_QUERY_AS_INPUT: "true" jobs: prepare: @@ -226,6 +227,14 @@ jobs: } }); } + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 + with: + version: ${{ env.BUILDX_VERSION }} + cache-binary: false + driver-opts: | + image=${{ env.BUILDKIT_IMAGE }} - name: Expose GitHub Runtime uses: crazy-max/ghaction-github-runtime@04d248b84655b509d8c44dc1d6f990c879747487 # v4.0.0 @@ -254,6 +263,7 @@ jobs: script: | const os = require('os'); const { Bake } = require('@docker/actions-toolkit/lib/buildx/bake'); + const { Build } = require('@docker/actions-toolkit/lib/buildx/build'); const { GitHub } = require('@docker/actions-toolkit/lib/github/github'); const { Util } = require('@docker/actions-toolkit/lib/util'); @@ -300,7 +310,7 @@ jobs: return; } - const bakeSource = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}.git#${process.env.GITHUB_REF}:${inpContext}`; + const bakeSource = await new Build().gitContext({subdir: inpContext}); await core.group(`Set bake source`, async () => { core.info(bakeSource); }); @@ -668,7 +678,7 @@ jobs: }; const renderTemplate = value => Handlebars.compile(value, {noEscape: true})({meta}); - const bakeSource = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}.git#${process.env.GITHUB_REF}:${inpContext}`; + const bakeSource = await new Build().gitContext({subdir: inpContext}); await core.group(`Set source output`, async () => { core.info(bakeSource); core.setOutput('source', bakeSource); diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be1e5c2..188f113 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -161,6 +161,7 @@ env: COSIGN_VERSION: "v3.0.2" LOCAL_EXPORT_DIR: "/tmp/buildx-output" MATRIX_SIZE_LIMIT: "20" + BUILDX_SEND_GIT_QUERY_AS_INPUT: "true" jobs: prepare: @@ -570,7 +571,7 @@ jobs: const renderTemplate = value => Handlebars.compile(value, {noEscape: true})({meta}); const toMultilineInput = value => value.split(/\r?\n/).map(line => line.trim()).filter(Boolean); - const buildContext = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}.git#${process.env.GITHUB_REF}:${inpContext}`; + const buildContext = await new Build().gitContext({subdir: inpContext}); core.setOutput('context', buildContext); switch (inpOutput) { From 7b10138162d256de2945a6f02b3c4caeca0af252 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Wed, 18 Mar 2026 11:28:15 +0100 Subject: [PATCH 3/3] test Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- .github/workflows/bake.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bake.yml b/.github/workflows/bake.yml index ab54a57..908c570 100644 --- a/.github/workflows/bake.yml +++ b/.github/workflows/bake.yml @@ -149,8 +149,8 @@ on: value: ${{ jobs.finalize.outputs.signed }} env: - BUILDX_VERSION: "v0.32.1" - BUILDKIT_IMAGE: "moby/buildkit:v0.28.0" + BUILDX_VERSION: "https://github.com/crazy-max/buildx.git#buildkit-fetch-depth" + BUILDKIT_IMAGE: "crazymax/buildkit:fetch-depth" SBOM_IMAGE: "docker/buildkit-syft-scanner:1.10.0" BINFMT_IMAGE: "tonistiigi/binfmt:qemu-v10.2.1-65" DOCKER_ACTIONS_TOOLKIT_MODULE: "@docker/actions-toolkit@0.84.1" @@ -204,7 +204,6 @@ jobs: uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: INPUT_IMAGES: | - ${{ env.BUILDKIT_IMAGE }} ${{ env.SBOM_IMAGE }} ${{ env.BINFMT_IMAGE }} with: @@ -310,7 +309,7 @@ jobs: return; } - const bakeSource = await new Build().gitContext({subdir: inpContext}); + const bakeSource = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}.git?ref=${process.env.GITHUB_REF}&subdir=${inpContext}&fetch-depth=0`; await core.group(`Set bake source`, async () => { core.info(bakeSource); }); @@ -678,7 +677,7 @@ jobs: }; const renderTemplate = value => Handlebars.compile(value, {noEscape: true})({meta}); - const bakeSource = await new Build().gitContext({subdir: inpContext}); + const bakeSource = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}.git?ref=${process.env.GITHUB_REF}&subdir=${inpContext}&fetch-depth=0`; await core.group(`Set source output`, async () => { core.info(bakeSource); core.setOutput('source', bakeSource);