githubnext / githubnext/agentics

It would be nice if Agentic workflows also cleaned up really old branches.

未关闭
#344 0 条评论 0 个 reaction 已指派 1 人 已被 @dsyme 认领 在 GitHub 查看
主要语言
Makefile
星标
952
派生
139
平均合并
6 天 10 小时
30 天内合并 PR
2

描述

It would be nice if Agentic workflows also cleaned up really old branches. I didn't realize that I have almost 150 remotes.

Biggest culprits

- repo-assist/ branches: 85 — the automated agent creates long-hash-suffixed branches, and when retries happen they chain (-hash1-hash2-hash3). These are never cleaned up.
- copilot/ branches: 28 — from Copilot coding agent sessions, also never auto-deleted.
- dependabot/, shanselman/, fix/, etc. — smaller numbers, normal.

### What cleans them today?
Almost nothing. You have:

stale.yml — marks stale PRs and issues after 14–27 days and closes them after 7 more days. But closing a PR does not delete its branch unless the repo setting "Automatically delete head branches" is enabled at the repository level.
No workflow or cron job that deletes branches after PR merge/close.
What should be done?
Enable "Automatically delete head branches" in repo Settings → General. This is the single biggest win — it auto-deletes branches when their PR is merged. It's a GitHub repo-level toggle, not a workflow setting.

Delete the 13 already-merged branches immediately. These are dead weight (e.g., copilot/tidy-remote-branches, pr-211-build-props, pr-triage, several repo-assist/eng-* branches).

Add a scheduled workflow to prune stale branches — e.g., delete remote branches older than 60 days that are either (a) fully merged, or (b) have no open PR. This catches the repo-assist/ retry chains that pile up with no PR at all.

Audit the 39 branches older than 60 days — most are abandoned repo-assist/ retry chains from March that will never be merged.
![Image](https://github.com/user-attachments/assets/3f5a6841-4212-42ab-bb0d-b621cb57254f)

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。