From fc8907c71ddd3122066f8a046d65541f0ce2821a Mon Sep 17 00:00:00 2001 From: "alex.stanfield" <13949480+chaptersix@users.noreply.github.com> Date: Fri, 21 Nov 2025 10:34:50 -0600 Subject: [PATCH] Make Docker image labels dynamic based on repository Add GITHUB_REPOSITORY variable and use it in OCI labels so GitHub correctly associates the package with the right repository. This fixes the issue where chaptersix/temporal-cli images were being associated with temporalio/cli repository. --- .github/docker/docker-bake.hcl | 8 ++++++-- .github/workflows/build-and-publish.yml | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/docker/docker-bake.hcl b/.github/docker/docker-bake.hcl index f890ae32e..0f158496c 100644 --- a/.github/docker/docker-bake.hcl +++ b/.github/docker/docker-bake.hcl @@ -10,6 +10,10 @@ variable "IMAGE_NAME" { default = "temporal" } +variable "GITHUB_REPOSITORY" { + default = "temporalio/cli" +} + variable "IMAGE_SHA_TAG" {} variable "IMAGE_BRANCH_TAG" {} @@ -46,8 +50,8 @@ target "cli" { labels = { "org.opencontainers.image.title" = "temporal" "org.opencontainers.image.description" = "Temporal CLI" - "org.opencontainers.image.url" = "https://github.com/temporalio/cli" - "org.opencontainers.image.source" = "https://github.com/temporalio/cli" + "org.opencontainers.image.url" = "https://github.com/${GITHUB_REPOSITORY}" + "org.opencontainers.image.source" = "https://github.com/${GITHUB_REPOSITORY}" "org.opencontainers.image.licenses" = "MIT" "org.opencontainers.image.revision" = "${CLI_SHA}" "org.opencontainers.image.created" = timestamp() diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 0ff8b0e68..9cc7b646a 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -194,6 +194,7 @@ jobs: IMAGE_REPO: ${{ steps.meta.outputs.image_repo }} IMAGE_NAMESPACE: ${{ steps.meta.outputs.image_namespace }} IMAGE_NAME: ${{ steps.meta.outputs.image_name }} + GITHUB_REPOSITORY: ${{ github.repository }} - name: Build Docker image if: ${{ !inputs.publish }} @@ -210,3 +211,4 @@ jobs: IMAGE_REPO: ${{ steps.meta.outputs.image_repo }} IMAGE_NAMESPACE: ${{ steps.meta.outputs.image_namespace }} IMAGE_NAME: ${{ steps.meta.outputs.image_name }} + GITHUB_REPOSITORY: ${{ github.repository }}