Skip to content

fix(ci): emit GHCR package description as index annotation#39

Merged
strausmann merged 1 commit into
mainfrom
fix/ghcr-index-annotation
May 10, 2026
Merged

fix(ci): emit GHCR package description as index annotation#39
strausmann merged 1 commit into
mainfrom
fix/ghcr-index-annotation

Conversation

@strausmann
Copy link
Copy Markdown
Owner

The problem

GHCR shows "No description provided" on the package pages for both label-printer-hub-backend and label-printer-hub-frontend, even though docker/metadata-action is configured with labels: org.opencontainers.image.description=….

Why

The description labels are baked into each per-platform image manifest, but GHCR's package UI reads the description from a separate place: the org.opencontainers.image.description annotation on the multi-arch manifest index (the OCI image-index that points at the per-arch manifests).

docker/metadata-action decides which manifest levels to annotate via the DOCKER_METADATA_ANNOTATIONS_LEVELS env var. Its default is manifest only, so the index never gets annotated — hence the empty GHCR page.

Quote from a previous run's logs (run 25638802588):

DOCKER_METADATA_OUTPUT_ANNOTATIONS:
  manifest:org.opencontainers.image.description=...
  manifest:org.opencontainers.image.title=...

→ Only manifest:, no index:.

The fix

Two small changes to .github/workflows/docker-publish.yml:

  1. At the workflow root: DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index — tells metadata-action to emit annotations for both levels.
  2. In the build step: annotations: \${{ steps.meta.outputs.annotations }} — forwards the resulting list to build-push-action, which translates it into --annotation manifest:* --annotation index:* calls on the underlying buildx invocation.

Verification (after merge)

gh workflow run docker-publish.yml -f tag=0.2.0 --ref main
# Wait for run to finish, then:
TOKEN=\$(curl -fsSL 'https://ghcr.io/token?scope=repository:strausmann/label-printer-hub-backend:pull&service=ghcr.io' | jq -r .token)
curl -fsSL -H \"Authorization: Bearer \$TOKEN\" \
  -H 'Accept: application/vnd.oci.image.index.v1+json' \
  https://ghcr.io/v2/strausmann/label-printer-hub-backend/manifests/0.2.0 \
  | jq '.annotations'

Should show org.opencontainers.image.description populated on the index.

GHCR package page will then display the description automatically — no further config needed.

Test plan

  • CI green.
  • Merge.
  • Re-run docker-publish for tag=0.2.0.
  • GHCR pages for both packages show the description.

GHCR shows "No description provided" on the package page because the
description annotation only lives on the per-platform manifests, not on
the multi-arch index. The package UI reads from the index level.

`docker/metadata-action` controls which manifest levels get annotations
via the `DOCKER_METADATA_ANNOTATIONS_LEVELS` env var. Default is
`manifest` only; setting it to `manifest,index` adds the second level.
We also have to forward the resulting annotation list through
`docker/build-push-action`'s `annotations:` input — the action doesn't
pick it up implicitly.

After this change the next docker-publish run will produce manifest
indexes with annotations on both levels, and GHCR's package page will
display the description without further intervention.
Copilot AI review requested due to automatic review settings May 10, 2026 20:31
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@strausmann strausmann merged commit 12c6b6c into main May 10, 2026
12 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Docker publish workflow so GHCR package pages display the intended OCI description by ensuring the org.opencontainers.image.description annotation is applied to the multi-arch image index (not just per-platform manifests).

Changes:

  • Configure docker/metadata-action to emit annotations for both manifest and index levels via DOCKER_METADATA_ANNOTATIONS_LEVELS.
  • Forward steps.meta.outputs.annotations into docker/build-push-action so buildx actually applies those index annotations during push.

github-actions Bot pushed a commit that referenced this pull request May 11, 2026
## <small>0.2.1 (2026-05-11)</small>

* fix(ci): emit GHCR package description as index annotation (#39) ([12c6b6c](12c6b6c)), closes [#39](#39)
* fix(ci): lowercase image ref before push-by-digest (#41) ([9dd954e](9dd954e)), closes [#41](#41)
* fix(ci): repair docker-publish.yml startup failure (#37) ([fb7cb59](fb7cb59)), closes [#37](#37)
* fix(ci): repair Verify multi-arch manifest step + drop fail-fast (#38) ([5d2ff7d](5d2ff7d)), closes [#38](#38)
* refactor(ci): split docker-publish into native-arch matrix + manifest merge (#40) ([8cd824d](8cd824d)), closes [#40](#40)
* chore(deps): bump github.com/go-chi/chi/v5 from 5.1.0 to 5.2.2 in /frontend (#36) ([a5971b9](a5971b9)), closes [#36](#36)

[skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants