Skip to content

fix(release): lowercase IMAGE_NAME for GHCR refs#47

Merged
Setounkpe7 merged 1 commit into
devfrom
fix/release-yml-lowercase-image-name
May 28, 2026
Merged

fix(release): lowercase IMAGE_NAME for GHCR refs#47
Setounkpe7 merged 1 commit into
devfrom
fix/release-yml-lowercase-image-name

Conversation

@Setounkpe7

Copy link
Copy Markdown
Owner

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

  • Image WAS pushed to GHCR at `ghcr.io/setounkpe7/threat-intel-api:sha-ff51baa`, `:main`, `:latest`
  • Image is UNSIGNED (cosign sign never ran)
  • No SBOM attestation attached
  • No SLSA L2 provenance attached
  • Railway production deploy succeeded — the running app has the new code (starlette fix, etc.)

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

  • `actionlint` passes
  • security.yml passes on this PR (it doesn't actually exercise release.yml)
  • After main merge: release.yml completes successfully end-to-end (smoke verify proves the chain)

🤖 Generated with Claude Code

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.
@Setounkpe7 Setounkpe7 merged commit ccef4bd into dev May 28, 2026
11 checks passed
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.

1 participant