From 625655df50820bf1a258583da0d8a5b906b0e8f1 Mon Sep 17 00:00:00 2001 From: Cailyn Sinclair Date: Tue, 17 Nov 2026 12:54:35 -0800 Subject: [PATCH] Normalize GHCR image repository names Lowercase the GitHub repository path before building and recording production image references. Add a workflow check so mixed-case repository names cannot break releases again. --- .github/workflows/deploy.yml | 4 +++- scripts/test-deploy-workflow.sh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f502394..c6a8e1a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -66,9 +66,10 @@ jobs: - name: Build and publish release image with retries id: build env: - IMAGE_TAG: ghcr.io/${{ github.repository }}:${{ needs.resolve.outputs.source_sha }} + IMAGE_REPOSITORY: ghcr.io/${{ github.repository }} SOURCE_SHA: ${{ needs.resolve.outputs.source_sha }} run: | + IMAGE_TAG="${IMAGE_REPOSITORY,,}:$SOURCE_SHA" for attempt in 1 2 3; do if docker buildx build . \ --build-arg "SOURCE_SHA=$SOURCE_SHA" \ @@ -96,6 +97,7 @@ jobs: IMAGE_REPOSITORY: ghcr.io/${{ github.repository }} IMAGE_DIGEST: ${{ steps.build.outputs.digest }} run: | + IMAGE_REPOSITORY="${IMAGE_REPOSITORY,,}" [[ "$IMAGE_DIGEST" =~ ^sha256:[0-9a-f]{64}$ ]] echo "image_ref=$IMAGE_REPOSITORY@$IMAGE_DIGEST" >> "$GITHUB_OUTPUT" diff --git a/scripts/test-deploy-workflow.sh b/scripts/test-deploy-workflow.sh index 5195651..7503218 100755 --- a/scripts/test-deploy-workflow.sh +++ b/scripts/test-deploy-workflow.sh @@ -20,6 +20,8 @@ assert_contains() { assert_contains "$WORKFLOW" 'workflows: [CI]' assert_contains "$WORKFLOW" 'branches: [master]' assert_contains "$WORKFLOW" "github.event.workflow_run.conclusion == 'success'" +assert_contains "$WORKFLOW" 'IMAGE_TAG="${IMAGE_REPOSITORY,,}:$SOURCE_SHA"' +assert_contains "$WORKFLOW" 'IMAGE_REPOSITORY="${IMAGE_REPOSITORY,,}"' assert_contains "$WORKFLOW" 'image_ref=$IMAGE_REPOSITORY@$IMAGE_DIGEST' assert_contains "$WORKFLOW" 'for attempt in 1 2 3; do' assert_contains "$WORKFLOW" '--cache-to type=gha,mode=max,scope=production-image'