ci: 💚 Correctly input Git SHA into docker build

This commit is contained in:
Jesse Wierzbinski 2024-07-26 00:10:42 +02:00
parent bc25896ed8
commit 39d9b4c031
No known key found for this signature in database

View file

@ -53,6 +53,9 @@ jobs:
uses: docker/metadata-action@v5 # v5.0.0 uses: docker/metadata-action@v5 # v5.0.0
with: with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 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 - name: Build and push Docker image
id: build-and-push id: build-and-push
@ -63,7 +66,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
build-args: | build-args: |
GIT_COMMIT=$(git rev-parse --short "$GITHUB_SHA") GIT_COMMIT=${{ env.GIT_COMMIT }}
provenance: mode=max provenance: mode=max
sbom: true sbom: true
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64