fix(release): lowercase IMAGE_NAME for GHCR refs#47
Merged
Conversation
GHCR (like all OCI registries) requires lowercase image references.
github.repository_owner preserves the user's mixed-case login
("Setounkpe7"), so:
IMAGE_NAME=Setounkpe7/threat-intel-api
The metadata-action lowercases tags for the push step automatically,
so `docker push` succeeded on the first main-branch run. But our
env-built digest reference
${REGISTRY}/${IMAGE_NAME}@${digest}
-> ghcr.io/Setounkpe7/threat-intel-api@sha256:...
was passed verbatim to Trivy, cosign sign, cosign attest, and the
smoke-verify step. Trivy failed first on run 26557127655 with:
unable to initialize container image: failed to parse the image
name: could not parse reference
Aborting the rest of the chain — image was pushed to GHCR but never
got its CycloneDX SBOM attestation, cosign signature, or SLSA L2
build provenance.
Fix: insert a one-line step right after Checkout that tr-lowercases
IMAGE_NAME and writes it back to GITHUB_ENV. All downstream steps
then see the canonical lowercased value via env.IMAGE_NAME / IMAGE_NAME.
2 tasks
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.
Summary
Hotfix for the first run of `release.yml` (run 26557127655) which failed at the Trivy SBOM step with:
```
unable to initialize container image:
failed to parse the image name: could not parse reference:
ghcr.io/Setounkpe7/threat-intel-api@sha256:6efd314f...
```
Root cause: GHCR (and all OCI registries) require lowercase image names. `github.repository_owner` preserves the user's mixed-case login. The `docker/metadata-action` lowercases tags for the push step automatically, so the image was successfully pushed to GHCR (under the lowercased name) — but our env-built digest reference kept the uppercase `S` and was rejected by Trivy, cosign sign, cosign attest, and the smoke-verify step.
Fix: add a single step right after Checkout that `tr`-lowercases `IMAGE_NAME` into `GITHUB_ENV`. All downstream steps then see the canonical lowercased value.
Impact of the first failed run
After this hotfix is merged through dev → main, the next `release.yml` run (either automatic on the merge commit, or via `workflow_dispatch`) will produce a fully signed and attested image.
Test plan
🤖 Generated with Claude Code