Lowercase Docker image repository names in workflows and build.sh
Merged
AW
2d ago+187+187+012345678901234567890123456789-7-7-0123456789
Fixes #16.
Problem
Docker image repository names must be lowercase, whereas github.repository preserves owner/repository casing (e.g. TaivasJumala/iosevka-nerd-font).
.github/workflows/release.yamlstill constructedIMAGE: ghcr.io/${{ github.repository }}and passed it directly todocker buildx imagetools create, failing for any owner/repo with uppercase letters..github/workflows/pr.yamldefinedIMAGE: ghcr.io/${{ github.repository }}at workflow scope (only working since11e50bcbecausedocker/metadata-action@v6internally lowercasesimages).build.shpassedIMAGEandIMAGE_REFdirectly todocker pullanddocker runwithout lowercasing the repository name, so mixed-case values faildocker run(or silently fall back to local builds duringdocker pull).
Changes
.github/workflows/release.yaml: Remove top-levelIMAGEand lowercasegithub.repositorybeforedocker buildx imagetools create..github/workflows/pr.yaml: Remove top-levelIMAGEand pass an explicitly lowercased image name todocker/metadata-action@v6.build.sh: Addnormalize_image_ref()to lowercase the repository name in bothIMAGEandIMAGE_REFwhile preserving registry ports, tag casing, and digests (compatible with Bash 3.2+).tests/test_build_cache.py: Add unit tests covering mixed-caseIMAGE_REFandIMAGEinputs (tags, registry ports, digests, and image IDs).
Verification
uv run python -m unittest discover -s tests -v— 12/12 passed/bin/bash -n build.shandtest_build_cache.pyunder macOS/bin/bash3.2 — passed- Workflow YAML syntax validated for
pr.yaml,release.yaml, andfork-release.yaml
Summary by cubic
Fixes #16 by lowercasing Docker image repository names so builds work with mixed-case GitHub owners or repositories.
- Workflows lowercase
github.repositorywhen creating image names. build.shlowercases repository paths while preserving registry domains, tags, digests, and image IDs.- Adds tests for mixed-case image references and registry handling.