Skip to content

Commit 5c33117

Browse files
committed
fix(docker): fix docker ci pushing incorrect metadata
1 parent 295a4d0 commit 5c33117

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/docker.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ jobs:
271271
tags: |
272272
type=semver,pattern={{version}}
273273
type=semver,pattern={{major}}.{{minor}}
274-
type=raw,value=latest,enable={{is_default_branch}}
274+
type=raw,value=latest
275275
labels: |
276276
org.opencontainers.image.title=${{ env.DOCKER_IMAGE_TITLE }}
277277
org.opencontainers.image.description=${{ env.DOCKER_IMAGE_DESCRIPTION }}
@@ -281,6 +281,21 @@ jobs:
281281
org.opencontainers.image.vendor=${{ env.DOCKER_IMAGE_VENDOR }}
282282
org.opencontainers.image.revision=${{ github.sha }}
283283
org.opencontainers.image.documentation=${{ env.DOCKER_IMAGE_DOCS }}
284+
# GHCR often reads description from OCI annotations (manifest/index)
285+
# rather than only image config labels, especially when Buildx produces
286+
# an OCI index (e.g. when provenance/attestations are attached).
287+
annotations: |
288+
org.opencontainers.image.title=${{ env.DOCKER_IMAGE_TITLE }}
289+
org.opencontainers.image.description=${{ env.DOCKER_IMAGE_DESCRIPTION }}
290+
org.opencontainers.image.source=${{ env.DOCKER_IMAGE_SOURCE }}
291+
org.opencontainers.image.licenses=${{ env.DOCKER_IMAGE_LICENSE }}
292+
org.opencontainers.image.authors=${{ env.DOCKER_IMAGE_AUTHORS }}
293+
org.opencontainers.image.vendor=${{ env.DOCKER_IMAGE_VENDOR }}
294+
org.opencontainers.image.revision=${{ github.sha }}
295+
org.opencontainers.image.documentation=${{ env.DOCKER_IMAGE_DOCS }}
296+
env:
297+
# Place annotations on both the manifest and (when present) the index.
298+
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
284299
- name: Generate Release Version
285300
id: release_version
286301
run: ./.github/scripts/docker.sh generate-release-version \ "${{ github.ref }}"
@@ -316,6 +331,8 @@ jobs:
316331
tags: ${{ steps.meta.outputs.tags }}
317332
# OCI labels for image metadata (title, description, source, license, etc.)
318333
labels: ${{ steps.meta.outputs.labels }}
334+
# OCI annotations for registry UIs (e.g. GHCR package description)
335+
annotations: ${{ steps.meta.outputs.annotations }}
319336
# Build-time variables passed to Containerfile
320337
build-args: |
321338
VERSION=${{ steps.release_version.outputs.version }}

0 commit comments

Comments
 (0)