feat(maintenance): report stale remote branches weekly - #55
Open
sajor2000 wants to merge 2 commits into
Open
Conversation
Greptile SummaryThe PR adds a read-only weekly GitHub Actions report that identifies remote branches requiring human review before cleanup.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; both previously reported issues are resolved in the current code.
|
| Filename | Overview |
|---|---|
| scripts/maintenance/report-branch-candidates.ts | Implements complete API pagination, branch classification, report rendering, and diagnostic failure output; the prior matching-merge issue is fixed. |
| .github/workflows/branch-maintenance.yml | Adds weekly and manual read-only reporting with both third-party actions pinned to immutable commit SHAs. |
| tests/branch-maintenance-report.test.ts | Covers matching merged evidence despite a newer unmerged PR, exclusions, no-candidate rendering, pagination, and malformed responses. |
| tests/branch-maintenance-workflow.test.ts | Verifies triggers, read-only permissions, immutable checkout pinning, and absence of common mutation commands. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Weekly schedule or manual dispatch] --> B[Read-only GitHub Actions job]
B --> C[Bun branch reporter]
C --> D[Fetch repository metadata and all branch pages]
D --> E[Fetch open and closed PRs per eligible branch]
E --> F{Default, protected, or open PR?}
F -->|Yes| G[Record exclusion]
F -->|No| H{Merged PR head matches current branch SHA?}
H -->|Yes| I[Record cleanup candidate]
H -->|No| G
I --> J[Publish job summary]
G --> J
Reviews (2): Last reviewed commit: "fix(maintenance): retain matching merge ..." | Re-trigger Greptile
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.
Summary
Adds a weekly, read-only GitHub Actions report for remote branches that need human review before cleanup. The workflow has manual dispatch, scoped read permissions, no deletion commands, and a Bun reporter with deterministic coverage for candidate classification and API pagination.
Validation
Backed up existing MCPorter config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/pi-backup-zM8sBB/.pi/ce-datascience/mcporter.json.bak.2026-08-19T17-25-06-395Z
Backed up existing settings.json to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/gemini-backup-wRVwUa/.gemini/settings.json.bak.2026-08-19T17-25-09-399Z
Backed up existing settings.json to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/gemini-merge-NMWtOk/.gemini/settings.json.bak.2026-08-19T17-25-09-400Z
Backed up existing mcp.json to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/kiro-backup-r3zHCq/.kiro/settings/mcp.json.bak.2026-08-19T17-25-10-571Z
Backed up existing mcp.json to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/kiro-merge-NpD6RU/.kiro/settings/mcp.json.bak.2026-08-19T17-25-10-573Z
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-backup-3go8hK/.opencode/opencode.json.bak.2026-08-19T17-25-10-651Z
Merged plugin config into existing opencode.json (user settings preserved)
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-merge-mcp-R7IHBR/.opencode/opencode.json.bak.2026-08-19T17-25-10-652Z
Merged plugin config into existing opencode.json (user settings preserved)
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-preserve-v14zg7/.opencode/opencode.json.bak.2026-08-19T17-25-10-653Z
Merged plugin config into existing opencode.json (user settings preserved)
Backed up existing command file to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-cmd-backup-nghmzv/.opencode/commands/my-cmd.md.bak.2026-08-19T17-25-10-660Z
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-managed-cleanup-krXgCV/.opencode/opencode.json.bak.2026-08-19T17-25-10-666Z
Merged plugin config into existing opencode.json (user settings preserved)
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-multi-plugin-fr9af9/.opencode/opencode.json.bak.2026-08-19T17-25-10-674Z
Merged plugin config into existing opencode.json (user settings preserved)
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/opencode-multi-plugin-fr9af9/.opencode/opencode.json.bak.2026-08-19T17-25-10-676Z
Merged plugin config into existing opencode.json (user settings preserved)
Backed up existing hooks to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-hooks-malformed-i7lUqg/.codex/hooks.json.bak.2026-08-19T17-25-15-405Z
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-backup-2wTkNR/.codex/config.toml.bak.2026-08-19T17-25-15-520Z
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-idempotent-BlSKJ9/.codex/config.toml.bak.2026-08-19T17-25-15-521Z
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-idempotent-BlSKJ9/.codex/config.toml.bak.2026-08-19T17-25-15-522Z
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-migrate-nouq0B/.codex/config.toml.bak.2026-08-19T17-25-15-524Z
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-unmarked-x6r66j/.codex/config.toml.bak.2026-08-19T17-25-15-525Z
Backed up existing config to /var/folders/rg/4tnm0m011c78ppqtvcbw158m0000gn/T/codex-stale-QSoyHN/.codex/config.toml.bak.2026-08-19T17-25-15-526Z (1,102 passed, 1 skipped)