ci(release): make CONSOLE_GIT_BRANCH lazy so it's skipped when overridden

Address review feedback from gemini-code-assist on
packages/system/dashboard/Makefile: switch CONSOLE_GIT_BRANCH from
immediate (:=) to deferred (=) assignment. With ?= short-circuiting the
fallback when CONSOLE_BRANCH is supplied (CI/release builds), lazy
evaluation skips the git rev-parse shell spawn entirely instead of
running it unconditionally at parse time. Resolved value is unchanged in
all build contexts.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
This commit is contained in:
Myasnikov Daniil committed 2026-06-18 18:08:41 +05:00
1 parent 604a44148b
commit fc0c09b837
1 file changed
+1 -1
+1 -1
View File
@@ -26,7 +26,7 @@ CONSOLE_REPO ?= https://github.com/cozystack/cozystack-ui.git
# tag checkout is a detached HEAD where the branch name is unavailable. For
# local/manual builds we derive it from the current branch: a release-X.Y
# checkout builds the matching UI branch; everything else builds from main.
CONSOLE_GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
CONSOLE_GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
CONSOLE_BRANCH ?= $(if $(filter release-%,$(CONSOLE_GIT_BRANCH)),$(CONSOLE_GIT_BRANCH),main)
image-console: clone-console build-console update-values-console clean-console