Stale Branch Cleanup Reminder
Example prompt: "Every Friday, list all branches on our GitHub repo that haven't had a commit in over 30 days. For each one, find the author and send them a Slack message asking if the branch can be deleted."
How to automate branch cleanup with GloriaMundo
The Problem
Repositories accumulate stale branches over time — experimental features that were abandoned, hotfixes that were merged but never deleted, or branches from people who have since left the team. A repository with 50+ stale branches makes it harder to find active work, clutters CI runners with unnecessary builds, and creates confusion about what is actually in progress. Nobody wants to spend their Friday afternoon auditing branch ages in the GitHub UI.
How GloriaMundo Solves It
We build a scheduled workflow that runs weekly. An integration step lists all branches on the target GitHub repository and fetches their last commit date and author. A code step filters the list to branches with no commits in the past 30 days, excluding protected branches like main, develop, and release branches. An LLM step drafts a short, polite message for each branch owner explaining that their branch appears inactive and asking whether it can be safely deleted. An integration step sends each message as a direct Slack notification to the branch author. Glass Box preview shows you the full list of stale branches and the messages that will be sent, so you can exclude any branches that should be kept.
Example Workflow Steps
- Trigger (scheduled): Runs every Friday at 10:00.
- Step 1 (integration): List all branches on the GitHub repository with their last commit date, author, and commit message.
- Step 2 (code): Filter to branches with no commits in over 30 days. Exclude protected branches (main, develop, release/*). Group by author.
- Step 3 (LLM): For each author, draft a short Slack message listing their stale branches and asking whether they can be archived or deleted.
- Step 4 (integration): Send each message as a direct Slack notification to the relevant team member.
Integrations Used
- GitHub — source of branch metadata, commit history, and author information
- Slack — delivers personalised cleanup reminders to branch owners
Who This Is For
Engineering leads and DevOps engineers responsible for repository hygiene, especially on teams with 10+ active contributors where stale branches accumulate quickly.
Time & Cost Saved
Manually auditing branches takes 20-30 minutes per repository, and most teams put it off indefinitely. This workflow automates the entire process for a few credits per weekly run. Over a month, it keeps repositories clean without anyone having to remember to do it.