mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:07:32 +00:00
use github.sha
This commit is contained in:
17
.github/workflows/login-container.yml
vendored
17
.github/workflows/login-container.yml
vendored
@@ -13,7 +13,7 @@ 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: ${{ jobs.login-container.outputs.login_build_image }}
|
value: ${{ inputs.login_build_image_name }}:${{ github.sha }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
@@ -34,19 +34,6 @@ jobs:
|
|||||||
login_build_image: ${{ steps.short-sha.outputs.login_build_image }}
|
login_build_image: ${{ steps.short-sha.outputs.login_build_image }}
|
||||||
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 "login_build_image=${{ inputs.login_build_image_name }}:$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
|
||||||
@@ -56,7 +43,7 @@ jobs:
|
|||||||
annotations: |
|
annotations: |
|
||||||
manifest:org.opencontainers.image.licenses=MIT
|
manifest:org.opencontainers.image.licenses=MIT
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=${{ steps.short-sha.outputs.short_sha }}
|
type=sha,prefix=,suffix=-debug,format=long
|
||||||
- name: Login to Docker registry
|
- name: Login to Docker registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
|
Reference in New Issue
Block a user