diff --git a/.github/workflows/bake.yml b/.github/workflows/bake.yml index ba2ca7e..908c570 100644 --- a/.github/workflows/bake.yml +++ b/.github/workflows/bake.yml @@ -149,15 +149,16 @@ 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.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" MATRIX_SIZE_LIMIT: "20" + BUILDX_SEND_GIT_QUERY_AS_INPUT: "true" jobs: prepare: @@ -203,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: @@ -226,6 +226,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 +262,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 +309,7 @@ jobs: return; } - const bakeSource = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}.git#${process.env.GITHUB_REF}:${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); }); @@ -668,7 +677,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 = `${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); diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d4ff39..188f113 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.84.1" 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) {