use github.sha

This commit is contained in:
Elio Bischof
2025-08-05 11:52:10 +02:00
parent 6eab49882f
commit acc1b0de25

View File

@@ -13,7 +13,7 @@ on:
outputs:
login_build_image:
description: 'The full image tag of the standalone login image'
value: ${{ jobs.login-container.outputs.login_build_image }}
value: ${{ inputs.login_build_image_name }}:${{ github.sha }}
permissions:
packages: write
@@ -34,19 +34,6 @@ jobs:
login_build_image: ${{ steps.short-sha.outputs.login_build_image }}
steps:
- 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 "login_build_image=${{ inputs.login_build_image_name }}:$SHORT_SHA" >> $GITHUB_OUTPUT
echo "Short SHA: $SHORT_SHA"
- name: Login meta
id: login-meta
uses: docker/metadata-action@v5
@@ -56,7 +43,7 @@ jobs:
annotations: |
manifest:org.opencontainers.image.licenses=MIT
tags: |
type=raw,value=${{ steps.short-sha.outputs.short_sha }}
type=sha,prefix=,suffix=-debug,format=long
- name: Login to Docker registry
uses: docker/login-action@v3
with: