diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2a7c0be..a7a8c4b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -88,10 +88,17 @@ jobs: cache_scope: amber-helper-pr-${{ github.event.pull_request.number }} runner: ubuntu-24.04-arm arch: arm64 - env: - IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} steps: - uses: actions/checkout@v5 + - name: Compute image registry (lowercase owner for GHCR) + id: registry + shell: bash + run: | + set -euo pipefail + owner_lc="$(printf '%s' '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + image_registry="ghcr.io/${owner_lc}" + echo "image_registry=${image_registry}" >> "$GITHUB_OUTPUT" + echo "IMAGE_REGISTRY=${image_registry}" >> "$GITHUB_ENV" - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 with: @@ -107,7 +114,7 @@ jobs: BUILD_MODE=release platforms: linux/${{ matrix.arch }} push: true - tags: ${{ env.IMAGE_REGISTRY }}/${{ matrix.image }}:${{ github.sha }}-${{ matrix.arch }} + tags: ${{ steps.registry.outputs.image_registry }}/${{ matrix.image }}:${{ github.sha }}-${{ matrix.arch }} cache-from: | type=gha,scope=refs/heads/main-${{ matrix.image }}-${{ matrix.arch }} type=gha,scope=${{ matrix.cache_scope }}-${{ matrix.arch }} @@ -121,9 +128,16 @@ jobs: permissions: contents: read packages: write - env: - IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} steps: + - name: Compute image registry (lowercase owner for GHCR) + id: registry + shell: bash + run: | + set -euo pipefail + owner_lc="$(printf '%s' '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + image_registry="ghcr.io/${owner_lc}" + echo "image_registry=${image_registry}" >> "$GITHUB_OUTPUT" + echo "IMAGE_REGISTRY=${image_registry}" >> "$GITHUB_ENV" - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 with: diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index ef65a66..83ef984 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -48,10 +48,17 @@ jobs: file: docker/amber-compose-helper/Dockerfile runner: ubuntu-24.04-arm arch: arm64 - env: - IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} steps: - uses: actions/checkout@v5 + - name: Compute image registry (lowercase owner for GHCR) + id: registry + shell: bash + run: | + set -euo pipefail + owner_lc="$(printf '%s' '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + image_registry="ghcr.io/${owner_lc}" + echo "image_registry=${image_registry}" >> "$GITHUB_OUTPUT" + echo "IMAGE_REGISTRY=${image_registry}" >> "$GITHUB_ENV" - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 with: @@ -62,7 +69,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ env.IMAGE_REGISTRY }}/${{ matrix.image }} + images: ${{ steps.registry.outputs.image_registry }}/${{ matrix.image }} tags: | type=ref,event=branch type=ref,event=tag @@ -92,9 +99,16 @@ jobs: permissions: contents: read packages: write - env: - IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} steps: + - name: Compute image registry (lowercase owner for GHCR) + id: registry + shell: bash + run: | + set -euo pipefail + owner_lc="$(printf '%s' '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" + image_registry="ghcr.io/${owner_lc}" + echo "image_registry=${image_registry}" >> "$GITHUB_OUTPUT" + echo "IMAGE_REGISTRY=${image_registry}" >> "$GITHUB_ENV" - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 with: @@ -105,7 +119,7 @@ jobs: id: cli_meta uses: docker/metadata-action@v5 with: - images: ${{ env.IMAGE_REGISTRY }}/amber-cli + images: ${{ steps.registry.outputs.image_registry }}/amber-cli tags: | type=ref,event=branch type=ref,event=tag @@ -122,7 +136,7 @@ jobs: id: sidecar_meta uses: docker/metadata-action@v5 with: - images: ${{ env.IMAGE_REGISTRY }}/amber-sidecar + images: ${{ steps.registry.outputs.image_registry }}/amber-sidecar tags: | type=ref,event=branch type=ref,event=tag @@ -139,7 +153,7 @@ jobs: id: helper_meta uses: docker/metadata-action@v5 with: - images: ${{ env.IMAGE_REGISTRY }}/amber-helper + images: ${{ steps.registry.outputs.image_registry }}/amber-helper tags: | type=ref,event=branch type=ref,event=tag