From ce4dd4c019047909566fb3f3878a92eff378c664 Mon Sep 17 00:00:00 2001 From: Hao Li <1127478+lihaosky@users.noreply.github.com> Date: Fri, 29 May 2026 11:16:45 -0700 Subject: [PATCH] [FLINK-39796] Fix snapshot bake by pinning bake-action to local source bake-action v7 changed the default of an unset `source` input: it now falls back to the workflow's git context and bakes it as a remote ref, so buildx fetches docker-bake.hcl and the build context from the triggering commit on master. That breaks the snapshot workflow for two reasons: 1. master's docker-bake.hcl lacks the `target "docker-metadata-action" {}` stub that every dev-* branch defines, so `inherits` fails with `failed to find target docker-metadata-action`. 2. the snapshot Dockerfile is generated at runtime by add-custom.sh into the local working tree and is not committed, so a remote bake context could not find it anyway. Setting `source: .` restores the pre-v7 behavior of baking the local working tree (the checked-out dev-* branch), which has both the generated Dockerfile and the docker-metadata-action stub. --- .github/workflows/snapshot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 604ab1b..be1cf8d 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -79,6 +79,14 @@ jobs: - name: "Build and push Docker images (supported platforms)" uses: docker/bake-action@6614cfa25eff9a0b2b2697efb0b6159e7680d584 with: + # bake-action >= v7 defaults an unset "source" to the workflow's git + # context and bakes it as a remote ref, which reads docker-bake.hcl and + # the build context from the triggering commit on master. This workflow + # needs the local working tree instead: the Dockerfile is generated at + # runtime by add-custom.sh, and the docker-metadata-action target it + # inherits is only defined in the checked-out dev-* branch. Pin to the + # local source to restore the pre-v7 behavior. + source: . files: | .github/workflows/docker-bake.hcl ${{ steps.meta.outputs.bake-file }}