From 39d9b4c0313700aaa7083ea99a5c1225ba728f2a Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Fri, 26 Jul 2024 00:10:42 +0200 Subject: [PATCH] ci: :green_heart: Correctly input Git SHA into docker build --- .github/workflows/docker-publish.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d4b9141b..0c92283d 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -53,6 +53,9 @@ jobs: uses: docker/metadata-action@v5 # v5.0.0 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Get the commit hash + run: echo "GIT_COMMIT=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV - name: Build and push Docker image id: build-and-push @@ -63,7 +66,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | - GIT_COMMIT=$(git rev-parse --short "$GITHUB_SHA") + GIT_COMMIT=${{ env.GIT_COMMIT }} provenance: mode=max sbom: true platforms: linux/amd64,linux/arm64