This commit is contained in:
Elio Bischof
2025-07-29 21:51:34 +02:00
parent 9dceb89f11
commit 4e6e2370db

View File

@@ -13,7 +13,6 @@ on:
outputs: outputs:
login_build_image: login_build_image:
description: 'The full image tag of the standalone login image' description: 'The full image tag of the standalone login image'
value: '${{ inputs.login_build_image_name }}:${{ github.event.pull_request.head.sha }}'
permissions: permissions:
packages: write packages: write
@@ -32,6 +31,18 @@ jobs:
packages: write packages: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Get short SHA
id: short-sha
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
# For PRs: Use the HEAD SHA (not the merge commit)
SHORT_SHA=$(echo "${{ github.event.pull_request.head.sha }}" | cut -c1-7)
else
# For pushes: Use the current commit
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
fi
echo "short_sha=$SHORT_SHA" >> $GITHUB_OUTPUT
echo "Short SHA: $SHORT_SHA"
- name: Login meta - name: Login meta
id: login-meta id: login-meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
@@ -41,7 +52,7 @@ jobs:
annotations: | annotations: |
manifest:org.opencontainers.image.licenses=MIT manifest:org.opencontainers.image.licenses=MIT
tags: | tags: |
type=sha,prefix=,suffix=,format=long type=raw,value=${{ steps.short-sha.outputs.short_sha }}
- name: Login to Docker registry - name: Login to Docker registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with: