Skip to content

Commit 9de8d23

Browse files
authored
🤖 ci: log dirty files during version stamping (#1167)
When `scripts/generate-version.sh` runs in a dirty git checkout, the generated `git_describe` ends up with a `-dirty` suffix. This adds a small debug block that prints the *tracked* dirty files (via `git diff-index`) so release/CI logs can show exactly what caused a dirty stamp. --- _Generated with `mux` • Model: `openai:gpt-5.2` • Thinking: `xhigh`_
1 parent be4ed30 commit 9de8d23

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/generate-version.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ GIT_COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
55
GIT_DESCRIBE=$(git describe --tags --always --dirty 2>/dev/null || echo "unknown")
66
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
77

8+
# If the build runs in a dirty git checkout, `git describe --dirty` includes "-dirty".
9+
# This extra output helps debug CI/release builds that end up stamped as dirty.
10+
if git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git rev-parse --verify HEAD >/dev/null 2>&1; then
11+
if ! git diff-index --quiet HEAD -- 2>/dev/null; then
12+
echo "⚠️ Git checkout is dirty; version will be stamped with '-dirty'."
13+
echo "Tracked dirty files:"
14+
git diff-index --name-only HEAD -- | sed 's/^/ - /'
15+
fi
16+
fi
17+
818
cat >src/version.ts <<EOF
919
// This file is auto-generated by scripts/generate-version.sh
1020
// Do not edit manually

0 commit comments

Comments
 (0)