🔧 FIX: Git identity setzen + Changes-Status checken via git status
docker-build-and-push / build (push) Successful in 18s

This commit is contained in:
KI-Sparringpartner
2026-08-03 20:16:36 +02:00
parent a18c53c211
commit 4a2951dd26
2 changed files with 56 additions and 7 deletions
+33 -1
View File
@@ -139,4 +139,36 @@ def push_changes(repo_path: Path, message: str = "Update 🧠", changelog_conten
["git", "push"], cwd=repo_path, capture_output=True, text=True
)
return {"success": result.returncode == 0, "output": result.stdout}
return {"success": result.returncode == 0, "output": result.stdout}
def get_git_status(repo_path: Path) -> dict:
"""Prueft den Status eines Git-Repo fuer aenderungen."""
# Setze git identity if not set (fuer Push ohne manuelle Konfig)
try:
subprocess.run(
["git", "config", "--global", "user.name", "KI-Sparringpartner"],
cwd=repo_path, capture_output=True
)
subprocess.run(
["git", "config", "--global", "user.email", "ai@local.internal"],
cwd=repo_path, capture_output=True
)
except Exception:
pass # Falls git config fehlschlaegt, versuch trotzdem push
# Check fuer uncommitted changes
result = subprocess.run(
["git", "status", "--porcelain"],
cwd=repo_path,
capture_output=True,
text=True
)
has_changes = bool(result.stdout.strip())
return {
"has_changes": has_changes,
"uncommitted_files": result.stdout.strip().split("\n") if result.stdout else [],
"can_push": has_changes
}