CI-Fix: Anleitungs-Stand liest Hash aus GITHUB_SHA wenn kein .git verfügbar
Build & Deploy / deploy (push) Successful in 25s

This commit is contained in:
2026-10-04 21:54:04 +02:00
parent 0e889ef05b
commit c71d9a82a1
+9 -2
View File
@@ -1,10 +1,17 @@
// Aktualisiert den Build-Stand der Anleitungsseite.
// Wird bei jedem Deploy (deploy.sh, Schritt 1) VOR dem Frontend-Build aufgerufen,
// Wird bei jedem Deploy (deploy.sh / CI-Pipeline) VOR dem Frontend-Build aufgerufen,
// damit Anleitung und ausgelieferte Version garantiert zusammenpassen.
// Hash-Quelle: git (lokal/Deploy-Skript) oder GITHUB_SHA (Gitea Actions, kein .git im Job-Container).
import { execSync } from 'node:child_process'
import { writeFileSync } from 'node:fs'
const hash = execSync('git rev-parse --short HEAD').toString().trim()
let hash = ''
try {
hash = execSync('git rev-parse --short HEAD').toString().trim()
} catch {
hash = (process.env.GITHUB_SHA || '').slice(0, 7)
}
if (!hash) hash = 'dev'
const datum = new Date().toLocaleString('de-DE', {
day: '2-digit', month: '2-digit', year: 'numeric',
hour: '2-digit', minute: '2-digit',