Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,14 @@ prod action="start":
build)
echo "🔨 Building and starting production..."

# Auto-detect git version: prioritize tag, then SHA, then "dev"
GIT_TAG=$(git describe --exact-match --tags 2>/dev/null || echo "")
# Auto-detect git version: combine tag and SHA for display
GIT_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
GIT_COMMIT=$(git rev-parse --short=7 HEAD 2>/dev/null || echo "dev")
if [ -n "$GIT_TAG" ]; then
export GIT_SHA="$GIT_TAG"
echo "📌 Building with tag: $GIT_SHA"
export GIT_SHA="${GIT_TAG} (${GIT_COMMIT})"
Comment on lines +188 to +192

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid showing nearest tag for untagged commits

Using git describe --tags --abbrev=0 returns the most recent reachable tag even when the current commit is not tagged, so the UI will display a release tag for builds from commits ahead of that tag. This regresses the prior exact-match behavior and can mislead operators into thinking a dev build is an official release (the commit hash in parentheses doesn’t prevent the mistaken “version” label). If the intent is only to show the tag when the current commit is tagged, you need --exact-match (or equivalent) before formatting ${GIT_TAG} (${GIT_COMMIT}).

Useful? React with 👍 / 👎.

echo "📌 Building with version: $GIT_SHA"
else
export GIT_SHA=$(git rev-parse --short=7 HEAD 2>/dev/null || echo "dev")
export GIT_SHA="$GIT_COMMIT"
echo "📌 Building with commit: $GIT_SHA"
fi

Expand Down