Skip to content

Commit b8dbe10

Browse files
author
ejacques
committed
Fix: lowercase image reference for OCI compliance
1 parent 47b2a52 commit b8dbe10

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
tags:
1010
- 'v*'
1111

12+
env:
13+
REGISTRY: ghcr.io
14+
IMAGE_NAME: ${{ github.repository }}
15+
1216
jobs:
1317
build-sign-release:
1418
runs-on: ubuntu-latest
@@ -27,7 +31,7 @@ jobs:
2731
- name: Login to GitHub Container Registry
2832
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
2933
with:
30-
registry: ghcr.io
34+
registry: ${{ env.REGISTRY }}
3135
username: ${{ github.actor }}
3236
password: ${{ secrets.GITHUB_TOKEN }}
3337

@@ -38,7 +42,7 @@ jobs:
3842
id: meta
3943
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
4044
with:
41-
images: ghcr.io/${{ github.repository }}
45+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4246
tags: |
4347
type=semver,pattern={{version}}
4448
type=semver,pattern={{major}}.{{minor}}
@@ -57,17 +61,22 @@ jobs:
5761
- name: Sign Container with Cosign (Keyless via Sigstore/OIDC)
5862
env:
5963
DIGEST: ${{ steps.build.outputs.digest }}
64+
# Lowercase the image name for OCI compliance
65+
IMAGE_REF: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6066
run: |
61-
IMAGE="ghcr.io/${{ github.repository }}@${DIGEST}"
67+
IMAGE_LOWER=$(echo "${IMAGE_REF}" | tr '[:upper:]' '[:lower:]')
68+
IMAGE="${IMAGE_LOWER}@${DIGEST}"
6269
echo "Signing image: $IMAGE"
6370
cosign sign --yes "$IMAGE"
6471
6572
- name: Create container-url.txt
6673
env:
6774
DIGEST: ${{ steps.build.outputs.digest }}
75+
IMAGE_REF: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6876
run: |
69-
# Include digest for immutable reference
70-
echo "ghcr.io/${{ github.repository }}@${DIGEST}" > container-url.txt
77+
# Lowercase and include digest for immutable reference
78+
IMAGE_LOWER=$(echo "${IMAGE_REF}" | tr '[:upper:]' '[:lower:]')
79+
echo "${IMAGE_LOWER}@${DIGEST}" > container-url.txt
7180
echo "Container URL: $(cat container-url.txt)"
7281
7382
- name: Create GitHub Release

0 commit comments

Comments
 (0)