🐛 fix: exclude untracked files from dirty git status

This commit is contained in:
2026-06-16 00:23:58 +07:00
parent 4a73901d0c
commit 2f8a2cb56d
+2 -1
View File
@@ -7,7 +7,8 @@ function getCommitHash(): string {
if (process.env.GITHUB_SHA) return process.env.GITHUB_SHA.slice(0, 7) if (process.env.GITHUB_SHA) return process.env.GITHUB_SHA.slice(0, 7)
try { try {
const hash = execSync('git rev-parse --short HEAD').toString().trim() const hash = execSync('git rev-parse --short HEAD').toString().trim()
const dirty = execSync('git status --porcelain').toString().trim().length > 0 const statusOut = execSync('git status --porcelain --untracked-files=no').toString()
const dirty = statusOut.trim().length > 0
return dirty ? `${hash}-dirty` : hash return dirty ? `${hash}-dirty` : hash
} catch { } catch {
return 'unknown' return 'unknown'