Skip to content

[fix] Delete branches merged into selected base (#16) - #22

Merged
ThreeLight2000 merged 2 commits into
mainfrom
fix/16-merged-branch-deletion
Aug 18, 2026
Merged

[fix] Delete branches merged into selected base (#16)#22
ThreeLight2000 merged 2 commits into
mainfrom
fix/16-merged-branch-deletion

Conversation

@ThreeLight2000

@ThreeLight2000 ThreeLight2000 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #16

Summary

  • delete eligible local branches with the selected merge base as the safety boundary
  • keep protecting the current and base branches
  • add a regression test for a branch merged into main while HEAD is elsewhere
  • remove obsolete type:* label enforcement from the branch-name workflow
  • upgrade actions/github-script to v8 for the Node 24 runner

Root cause

The cleanup candidate list is computed with git for-each-ref --merged <base>, but git branch -d performs its safety check against the current HEAD when no upstream is configured. A branch can therefore be safely merged into the selected base yet fail deletion from another branch. The fix uses force deletion only after the candidate has passed the selected-base merge check.

Verification

  • pnpm verify
  • node --test --test-reporter=dot scripts/cleanup-merged.test.mjs (5 tests)
  • git diff --check

Scope

Repository tooling and pull request validation only; no client or server runtime behavior changes.

@ThreeLight2000
ThreeLight2000 marked this pull request as ready for review August 18, 2026 18:23
@ThreeLight2000
ThreeLight2000 merged commit 0fb904e into main Aug 18, 2026
4 of 5 checks passed
@ThreeLight2000
ThreeLight2000 deleted the fix/16-merged-branch-deletion branch August 18, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[chore] Add merged branch and worktree cleanup script

1 participant