diff --git a/.github/workflows/bake.yml b/.github/workflows/bake.yml index ba2ca7e..570d59c 100644 --- a/.github/workflows/bake.yml +++ b/.github/workflows/bake.yml @@ -153,11 +153,12 @@ 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.85.0" HANDLEBARS_MODULE: "handlebars@4.7.8" 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 4d4ff39..afb8ccf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -156,11 +156,12 @@ 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.85.0" HANDLEBARS_MODULE: "handlebars@4.7.8" 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) {