fix(ci): lowercase image ref before push-by-digest#41
Merged
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
GitHub stores the repo path with the casing the user picked. Our repo
is `strausmann/Label-Printer-Hub`, so `${{ github.repository }}` keeps
the capital L/P/H. Docker/OCI registry references MUST be all-lowercase,
or buildx rejects the push with:
ERROR: failed to build: failed to solve: failed to parse ref
"ghcr.io/strausmann/Label-Printer-Hub-frontend":
invalid reference format: repository name
(strausmann/Label-Printer-Hub-frontend) must be lowercase
The old workflow accidentally side-stepped this because
`docker/metadata-action` lowercases `images:` for its own outputs.
The new pipeline pushes by digest via `build-push-action`'s
`outputs: name=…` field, which is a raw passthrough — the casing
from `${{ github.repository }}` reached buildx unchanged.
Both phases (build and merge) now have a `Compute lowercase image ref`
step that uses bash's `${VAR,,}` lowercase expansion, and reference
that step's output everywhere a registry ref appears.
60cdf7d to
37eb08e
Compare
There was a problem hiding this comment.
Pull request overview
Fixes the Docker publish workflow failing on mixed-case GitHub repo names by normalizing the GHCR image reference to lowercase before using it in push-by-digest and manifest-merge operations.
Changes:
- Add a
Compute lowercase image refstep (in both build + merge phases) and route all GHCR image refs throughsteps.image.outputs.ref. - Update the build phase to use the computed lowercase ref in
build-push-action’soutputs: type=image,name=…(push-by-digest). - Update metadata/merge steps to also use the computed lowercase image ref when assembling and tagging the multi-arch manifest.
Comments suppressed due to low confidence (1)
.github/workflows/docker-publish.yml:105
- In the build phase, the Docker Hub login step appears unused now (the build only pushes by digest to the GHCR
name=...reference). Consider removing this login from the build job and keeping Docker Hub auth only in the merge job where tags/manifests are pushed.
- name: Log in to Docker Hub
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
if: env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != ''
Comment on lines
151
to
155
| file: ./${{ matrix.service }}/Dockerfile | ||
| platforms: ${{ matrix.platform }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| # `push-by-digest=true` skips the tag write and returns digest in | ||
| # `steps.build.outputs.digest`. `name-canonical=true` makes the |
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]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
After #40 was merged, the first run on the native-arm64 pipeline failed in all four build legs with:
Root cause
The GitHub repository is named
Label-Printer-Hub(mixed case).\${{ github.repository }}keeps that casing, but OCI/Docker registry refs must be all-lowercase. The old single-phase workflow accidentally side-stepped this becausedocker/metadata-actionlowercases the values it emits inoutputs.tags/outputs.labels. The new two-phase workflow pushes by digest viabuild-push-action'soutputs: name=…field, which is a raw passthrough — the mixed-case repo path reached buildx unchanged.Fix
Both phases get an early
Compute lowercase image refstep that does:(
\${VAR,,}is bash's lowercase parameter expansion — POSIX shell would needtr, but the runner is bash.)Every place the workflow needed a registry ref now uses
\${{ steps.image.outputs.ref }}:metadata-action images:(build + merge)build-push-action outputs: name=…(build)DIGEST_REPOenv in the merge stepVerification (after merge)
Expect: 4 native build jobs in ~30-45 s each, 2 merge jobs in ~10 s each, total run ~1:30 (vs. ~3:54 on the QEMU pipeline).