Repository navigation
Add automatic branch cleanup workflow - #8
Merged
Merged
Conversation
Same policy as atlas-commerce: delete a PR's head branch once it closes (when merged, or fully contained in main), plus a Monday weekly sweep of branches that are fully merged and have no open PR, including leftover arena/* branches. Never touches main, branches with an open PR, protected branches, or unmerged work. Adds a dry_run manual trigger the atlas version does not have. Also documents it in the root README. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
.github/workflows/branch-cleanup.yml, mirroringatlas-commerce'sbranch-cleanup.ymlwith two hardening changes.Policy (same as atlas-commerce)
mainmainand has no open PR — including leftoverarena/*session branchesdry_runWhat it never touches
main— skipped by name, resolved from the API rather than hardcodedDifferences from the atlas-commerce version
dry_runinput — manual runs can printWOULD DELETEwithout deleting. Useful to see what a first sweep would remove before letting it run weekly.repos/$REPO → .default_branch) instead of hardcodingmain, and the PR-close step also skips protected branches — the atlas version checks protection only in the sweep.Everything else is deliberately identical, including the
/→%2Fescaping forarena/...branch names andset -euo pipefail.Verified
run:block passesbash -nmainexists, no open PRs — so the first sweep is a no-op until session branches accumulateNote
The workflow uses the default
GITHUB_TOKENwithcontents: write. If branch protection onmainblocks the Actions bot, deletions are skipped with a logged message rather than failing the job.