Skip to content

Commit 0bc9c2e

Browse files
tparnellclaude
andcommitted
chore: add stale branch cleanup workflow
Org-wide rollout to keep repositories clean. - Branches matching feature/*, fix/*, release/* marked stale after 30 days, deleted after 7 more days. Open PRs always protected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b2f59be commit 0bc9c2e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Marks stale, then deletes, stale branches. See:
2+
# https://github.com/marketplace/actions/remove-stale-branches
3+
#
4+
# Part of an org-wide rollout. Timing is staggered across repos
5+
# to avoid GitHub API rate limits (9:00-9:59 AM ET window).
6+
7+
name: 'Stale Branches'
8+
on:
9+
schedule:
10+
# Runs at 9:05 AM Eastern, Monday-Friday (14:05 UTC)
11+
- cron: '5 14 * * 1-5'
12+
workflow_dispatch: # Allow manual trigger
13+
14+
permissions:
15+
contents: write
16+
pull-requests: read
17+
18+
jobs:
19+
remove-stale-branches:
20+
name: Stale Branches
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: fpicalausa/remove-stale-branches@v2.4.0
24+
with:
25+
days-before-branch-stale: 30
26+
days-before-branch-delete: 7
27+
# Only target conventional branch prefixes
28+
restrict-branches-regex: '^(feature|fix|release)/'
29+
ignore-branches-with-open-prs: true
30+
operations-per-run: 100

0 commit comments

Comments
 (0)