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