From 28ae34b638f04a8a61d4b30c1baac2ecb4bb3ef3 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Fri, 24 Oct 2025 11:34:03 +0200 Subject: [PATCH] fix: correctly pass git commit to docker build --- .gitea/workflows/build.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 10e09ea..00c06c9 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -70,12 +70,7 @@ jobs: username: ${{ gitea.actor }} password: ${{ secrets.REGISTRY_TOKEN }} - # Step 8: Get the short commit SHA to use as an image tag. - - name: Get short commit hash - id: commit - run: echo "sha_short=$(echo ${{ gitea.sha }} | cut -c1-7)" >> $GITEA_OUTPUT - - # Step 9: Build the Docker image and push it to the Gitea registry. + # Step 8: Build the Docker image and push it to the Gitea registry. # The image is tagged with 'latest' and the short commit SHA. - name: Build and push Docker image uses: docker/build-push-action@v5 @@ -85,6 +80,6 @@ jobs: push: true tags: | git.max-richter.dev/${{ gitea.repository }}:latest - git.max-richter.dev/${{ gitea.repository }}:${{ steps.commit.outputs.sha_short }} + git.max-richter.dev/${{ gitea.repository }}:${{ gitea.sha }} build-args: | - GIT_COMMIT=${{ gitea.commit_sha }} + GIT_COMMIT=${{ gitea.sha }}