Compare commits
1 Commits
fix/1548-u
...
fix/cleanu
| Author | SHA1 | Date | |
|---|---|---|---|
| dc210580e2 |
@@ -9,28 +9,28 @@
|
||||
},
|
||||
"files": {
|
||||
"index.html": {
|
||||
"sha256": "562418d180da01b0eae320ee6604c33cf70aeee03d0ff918c27d0aa36509d6d5",
|
||||
"size": 20989
|
||||
"sha256": "71ba27afe8b6b42a09efe09d2b3017599392ddc3bc02543b31c2277dfb0b82cc",
|
||||
"size": 25933
|
||||
},
|
||||
"app.js": {
|
||||
"sha256": "df304e3d4d76ecca6f84a477d7729625fe51ff23ef3a24df554a61cf5b8f2d43",
|
||||
"size": 140652
|
||||
"sha256": "2b765a724a0fcda29abd40ba921bc621d2699f11d0ba14cf1579cbbdafdc5cd5",
|
||||
"size": 132902
|
||||
},
|
||||
"style.css": {
|
||||
"sha256": "a7228e516f8210bac580a1caa2f6223ec9ec533e46c58b585a7cbc53bc047fba",
|
||||
"size": 60727
|
||||
"sha256": "cd3068d03eed6f52a00bbc32cfae8fba4739b8b3cb194b3ec09fd747a075056d",
|
||||
"size": 44198
|
||||
},
|
||||
"gofai_worker.js": {
|
||||
"sha256": "01d1444b1e4c899a7579aa4e5624d5a0683e10b54a924005a7003534c607a500",
|
||||
"size": 1925
|
||||
"sha256": "d292f110aa12a8aa2b16b0c2d48e5b4ce24ee15b1cffb409ab846b1a05a91de2",
|
||||
"size": 969
|
||||
},
|
||||
"server.py": {
|
||||
"sha256": "79292dfd6955020f5d8ae368e8ce61a4831255dc1a935cbf8f51b35eaa2e4498",
|
||||
"size": 4389
|
||||
"sha256": "e963cc9715accfc8814e3fe5c44af836185d66740d5a65fd0365e9c629d38e05",
|
||||
"size": 4185
|
||||
},
|
||||
"portals.json": {
|
||||
"sha256": "82f91c3b8707d197e6295e594e616e92f9e215399a7181a130874e23381efa9f",
|
||||
"size": 6399
|
||||
"sha256": "889a5e0f724eb73a95f960bca44bca232150bddff7c1b11f253bd056f3683a08",
|
||||
"size": 3442
|
||||
},
|
||||
"vision.json": {
|
||||
"sha256": "0e3b5c06af98486bbcb2fc2dc627dc8b7b08aed4c3a4f9e10b57f91e1e8ca6ad",
|
||||
@@ -41,8 +41,8 @@
|
||||
"size": 495
|
||||
},
|
||||
"nexus/components/spatial-memory.js": {
|
||||
"sha256": "0945845828b3cfaac6060050bf138463b5108b6c135e4c396751da92a7376534",
|
||||
"size": 38272
|
||||
"sha256": "60170f6490ddd743acd6d285d3a1af6cad61fbf8aaef3f679ff4049108eac160",
|
||||
"size": 32782
|
||||
},
|
||||
"nexus/components/session-rooms.js": {
|
||||
"sha256": "9997a60dda256e38cb4645508bf9e98c15c3d963b696e0080e3170a9a7fa7cf1",
|
||||
|
||||
@@ -168,3 +168,62 @@ else
|
||||
fi
|
||||
|
||||
log "Script complete"
|
||||
|
||||
# ─── Stale Branch Cleanup ─────────────────────────────────
|
||||
# Clean up branches from closed (unmerged) PRs and merged PRs
|
||||
log "Checking for stale branches from closed/merged PRs..."
|
||||
|
||||
# Get all open PRs to avoid deleting active branches
|
||||
OPEN_BRANCHES=$(curl -s -H "$AUTH" "$API/repos/$REPO/pulls?state=open&limit=100" | jq -r '.[] | .head.ref' | sort -u)
|
||||
|
||||
# Get all closed PRs (last 100)
|
||||
CLOSED_PRS=$(curl -s -H "$AUTH" "$API/repos/$REPO/pulls?state=closed&limit=100")
|
||||
|
||||
if [ -n "$CLOSED_PRS" ] && [ "$CLOSED_PRS" != "null" ]; then
|
||||
STALE_BRANCHES=$(echo "$CLOSED_PRS" | jq -r '.[] | select(.merged == false) | .head.ref' | sort -u)
|
||||
MERGED_BRANCHES=$(echo "$CLOSED_PRS" | jq -r '.[] | select(.merged == true) | .head.ref' | sort -u)
|
||||
|
||||
STALE_COUNT=0
|
||||
for branch in $STALE_BRANCHES; do
|
||||
# Skip main/master/develop
|
||||
case "$branch" in main|master|develop|HEAD) continue ;; esac
|
||||
|
||||
# SAFETY CHECK: Skip if branch is still used by an open PR
|
||||
if echo "$OPEN_BRANCHES" | grep -q "^$branch$"; then
|
||||
log "Skipping branch '$branch' - still has an open PR"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$DRY_RUN" = "true" ]; then
|
||||
log "DRY RUN: Would delete stale branch '$branch' (from closed unmerged PR)"
|
||||
else
|
||||
curl -s -X DELETE -H "$AUTH" "$API/repos/$REPO/branches/$branch" > /dev/null 2>&1 || true
|
||||
log "Deleted stale branch: $branch"
|
||||
fi
|
||||
STALE_COUNT=$((STALE_COUNT + 1))
|
||||
done
|
||||
|
||||
MERGED_COUNT=0
|
||||
for branch in $MERGED_BRANCHES; do
|
||||
case "$branch" in main|master|develop|HEAD) continue ;; esac
|
||||
|
||||
if echo "$OPEN_BRANCHES" | grep -q "^$branch$"; then
|
||||
log "Skipping branch '$branch' - still has an open PR"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ "$DRY_RUN" = "true" ]; then
|
||||
log "DRY RUN: Would delete merged branch '$branch'"
|
||||
else
|
||||
curl -s -X DELETE -H "$AUTH" "$API/repos/$REPO/branches/$branch" > /dev/null 2>&1 || true
|
||||
log "Deleted merged branch: $branch"
|
||||
fi
|
||||
MERGED_COUNT=$((MERGED_COUNT + 1))
|
||||
done
|
||||
|
||||
log "Stale branch cleanup:"
|
||||
log " Closed (unmerged) branches: $STALE_COUNT"
|
||||
log " Merged branches: $MERGED_COUNT"
|
||||
else
|
||||
log "Could not fetch closed PRs for branch cleanup"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user