mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-16 23:24:55 -05:00
[PR #1956] chore: clean up stale merged branches, add auto-cleanup workflow #34680
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1956
Author: @Shashank-Tripathi-07
Created: 7/9/2026
Status: 🔄 Open
Base:
dev← Head:chore/cleanup-stale-branches📝 Commits (1)
d75f5e3chore: add workflow to auto-delete stale merged branches📊 Changes
1 file changed (+90 additions, -0 deletions)
View changed files
➕
.github/workflows/infra-cleanup-stale-branches.yml(+90 -0)📄 Description
Why
The repo has accumulated a lot of branches that are fully merged into
dev/mainand no longer serve any purpose. Right now the following are already merged into both and are safe to delete immediately:@profvjreddi, could you delete these (or grant delete access to whoever manages the repo) when you get a chance? Deleting a merged branch is safe since every commit already lives on
dev/main.What this PR adds
To stop this from recurring, this adds
.github/workflows/infra-cleanup-stale-branches.yml, which weekly (Monday 4am UTC) finds branches that are:devmain,dev, orgh-pagesand deletes them. It also supports
workflow_dispatchwith adry_runtoggle so it can be tested or run on demand before trusting the schedule.This only ever touches branches whose commits are already an ancestor of
dev, so it cannot lose work.Test plan
workflow_dispatchwithdry_run: trueto confirm the candidate list matches the branches abovemain,dev,gh-pages) and open-PR branches are untouched🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.