lowercase registry names

This commit is contained in:
Niklas Haiden
2025-09-24 20:44:36 +02:00
parent 19cdc95c24
commit af311eac78
+14 -5
View File
@@ -39,6 +39,15 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Lowercase registry names
id: registry
run: |
echo "image_registry=ghcr.io/${OWNER,,}" >> $GITHUB_OUTPUT
echo "username=${ACTOR,,}" >> $GITHUB_OUTPUT
env:
OWNER: ${{ github.repository_owner }}
ACTOR: ${{ github.actor }}
- name: Get current date - name: Get current date
id: date id: date
run: | run: |
@@ -92,7 +101,7 @@ jobs:
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ steps.registry.outputs.username }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Push To GHCR - name: Push To GHCR
@@ -100,10 +109,10 @@ jobs:
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
id: push id: push
env: env:
REGISTRY_USER: ${{ github.actor }} REGISTRY_USER: ${{ steps.registry.outputs.username }}
REGISTRY_PASSWORD: ${{ github.token }} REGISTRY_PASSWORD: ${{ github.token }}
with: with:
registry: ${{ env.IMAGE_REGISTRY }} registry: ${{ steps.registry.outputs.image_registry }}
image: ${{ env.IMAGE_NAME }} image: ${{ env.IMAGE_NAME }}
tags: ${{ steps.metadata.outputs.tags }} tags: ${{ steps.metadata.outputs.tags }}
username: ${{ env.REGISTRY_USER }} username: ${{ env.REGISTRY_USER }}
@@ -116,11 +125,11 @@ jobs:
- name: Sign container image - name: Sign container image
if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
run: | run: |
IMAGE_FULL="${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}" IMAGE_FULL="${{ steps.registry.outputs.image_registry }}/${{ env.IMAGE_NAME }}"
for tag in ${{ steps.metadata.outputs.tags }}; do for tag in ${{ steps.metadata.outputs.tags }}; do
cosign sign -y --key env://COSIGN_PRIVATE_KEY $IMAGE_FULL:$tag cosign sign -y --key env://COSIGN_PRIVATE_KEY $IMAGE_FULL:$tag
done done
env: env:
TAGS: ${{ steps.push.outputs.digest }} TAGS: ${{ steps.push.outputs.digest }}
COSIGN_EXPERIMENTAL: false COSIGN_EXPERIMENTAL: false
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }} COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}