Skip to content

Commit 90d4238

Browse files
authored
Merge pull request #7 from chaptersix/fix-ghcr-registry-prefix
Make Docker image labels dynamic based on repository
2 parents 16e76e4 + fc8907c commit 90d4238

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/docker/docker-bake.hcl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ variable "IMAGE_NAME" {
1010
default = "temporal"
1111
}
1212

13+
variable "GITHUB_REPOSITORY" {
14+
default = "temporalio/cli"
15+
}
16+
1317
variable "IMAGE_SHA_TAG" {}
1418

1519
variable "IMAGE_BRANCH_TAG" {}
@@ -46,8 +50,8 @@ target "cli" {
4650
labels = {
4751
"org.opencontainers.image.title" = "temporal"
4852
"org.opencontainers.image.description" = "Temporal CLI"
49-
"org.opencontainers.image.url" = "https://github.com/temporalio/cli"
50-
"org.opencontainers.image.source" = "https://github.com/temporalio/cli"
53+
"org.opencontainers.image.url" = "https://github.com/${GITHUB_REPOSITORY}"
54+
"org.opencontainers.image.source" = "https://github.com/${GITHUB_REPOSITORY}"
5155
"org.opencontainers.image.licenses" = "MIT"
5256
"org.opencontainers.image.revision" = "${CLI_SHA}"
5357
"org.opencontainers.image.created" = timestamp()

.github/workflows/build-and-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ jobs:
194194
IMAGE_REPO: ${{ steps.meta.outputs.image_repo }}
195195
IMAGE_NAMESPACE: ${{ steps.meta.outputs.image_namespace }}
196196
IMAGE_NAME: ${{ steps.meta.outputs.image_name }}
197+
GITHUB_REPOSITORY: ${{ github.repository }}
197198

198199
- name: Build Docker image
199200
if: ${{ !inputs.publish }}
@@ -210,3 +211,4 @@ jobs:
210211
IMAGE_REPO: ${{ steps.meta.outputs.image_repo }}
211212
IMAGE_NAMESPACE: ${{ steps.meta.outputs.image_namespace }}
212213
IMAGE_NAME: ${{ steps.meta.outputs.image_name }}
214+
GITHUB_REPOSITORY: ${{ github.repository }}

0 commit comments

Comments
 (0)