Add branch-cleanup mise task #247

Merged
eblume merged 7 commits from feature/branch-cleanup-task into main 2026-02-22 16:00:09 -08:00
Owner

Summary

  • New mise run branch-cleanup task that finds branches merged into main and deletes them locally and on the Forgejo remote
  • Configurable --cutoff (default 30 days) skips branches with recent HEAD commits
  • Supports --dry-run, --local-only, --remote-only flags
  • Interactive confirmation before any deletion

Test plan

  • mise run branch-cleanup -- --dry-run shows correct table of candidates
  • Run without --dry-run to confirm actual deletion works
## Summary - New `mise run branch-cleanup` task that finds branches merged into main and deletes them locally and on the Forgejo remote - Configurable `--cutoff` (default 30 days) skips branches with recent HEAD commits - Supports `--dry-run`, `--local-only`, `--remote-only` flags - Interactive confirmation before any deletion ## Test plan - [x] `mise run branch-cleanup -- --dry-run` shows correct table of candidates - [ ] Run without `--dry-run` to confirm actual deletion works
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Needed for non-TTY contexts where the prompt defaults to N.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Uses the Forgejo PR API to find branches from merged PRs, catching
squash-merged branches that git --merged misses. Also warns about
stale local branches that couldn't be confirmed as merged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Switch remote branch deletion from git push to Forgejo API
- Token resolved from 1Password locally, --token flag for CI
- Add branch-cleanup.yaml workflow: runs ~every 10 days on schedule,
  supports manual dispatch with configurable cutoff
- Shallow checkout sufficient (no fetch-depth: 0 needed)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Avoids exposing the token in process listings. Resolution order:
--token flag > FORGEJO_TOKEN env > 1Password op read.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
eblume merged commit abb7e6fe88 into main 2026-02-22 16:00:09 -08:00
eblume referenced this pull request from a commit 2026-02-22 16:00:11 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
eblume/blumeops!247
No description provided.