From 852f0bef263337e46f3ade139b52abe5976d25e3 Mon Sep 17 00:00:00 2001 From: Rashmi Gottipati Date: Tue, 3 Jun 2025 16:23:16 -0400 Subject: [PATCH] use SOURCE_GIT_COMMIT if available for the GIT_COMMIT Signed-off-by: Rashmi Gottipati --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index a0c9ff7e6..6d47325d7 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ SHELL := /usr/bin/env bash -o pipefail .SHELLFLAGS := -ec export ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +# use CI-provided SOURCE_GIT_COMMIT if available, fallback to local git commit ID +export GIT_COMMIT := $(or $(SOURCE_GIT_COMMIT),$(shell git rev-parse HEAD)) + GOLANG_VERSION := $(shell sed -En 's/^go (.*)$$/\1/p' "go.mod") # Image URL to use all building/pushing image targets ifeq ($(origin IMAGE_REGISTRY), undefined)