From d02f522cbcc55197af688b0c77cf1b2e32da85f3 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 7 Feb 2026 16:32:07 -0500 Subject: [PATCH] feat: git-audit auto-commits and pushes owned repos --- scripts/git-audit.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/git-audit.sh b/scripts/git-audit.sh index 8739f06..0a83b1b 100755 --- a/scripts/git-audit.sh +++ b/scripts/git-audit.sh @@ -55,6 +55,20 @@ audit_repo() { fi fi + # Auto-commit repos I own (skip inou — Johan's code) + if [ "$DIRTY_COUNT" -gt 0 ] && [ "$repo" != "inou" ]; then + git -C "$dir" add -A 2>/dev/null + git -C "$dir" commit -m "chore: auto-commit uncommitted changes" --quiet 2>/dev/null && { + AHEAD=$(git -C "$dir" rev-list --count "origin/$BRANCH..HEAD" 2>/dev/null || echo 0) + } + DIRTY_COUNT=0 + fi + + # Auto-push if ahead + if [ "$AHEAD" -gt 0 ] && [ "$repo" != "inou" ]; then + timeout 5 git -C "$dir" push origin "$BRANCH" --quiet 2>/dev/null && AHEAD=0 || true + fi + [ "$DIRTY_COUNT" -gt 0 ] && ANOMALIES+="⚠️ $repo: $DIRTY_COUNT uncommitted file(s)\n" [ "$AHEAD" -gt 0 ] && ANOMALIES+="🔺 $repo: $AHEAD unpushed commit(s) on $BRANCH\n" }