Skip to content
Merged
24 changes: 24 additions & 0 deletions .github/workflows/remove-stale-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Remove Stale Branches

on:
schedule:
- cron: "0 0 * * *" # Everday at midnight
workflow_dispatch: # Allows manual trigger from GitHub UI

permissions:
contents: write

jobs:
remove-stale-branches:
runs-on: ubuntu-latest
steps:
- uses: fpicalausa/[email protected]
with:
dry-run: false # Check out the console output before setting this to false
exempt-authors-regex: "^dependabot"
days-before-branch-stale: 90
days-before-branch-delete: 7
operations-per-run: 100
exempt-branches-regex: "^(main|release-dev/.*|v[0-9]+\\.[0-9]+\\.[0-9]+)$"
ignore-unknown-authors: true
default-recipient: "bowenli86"
20 changes: 20 additions & 0 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,26 @@ When merging a complete `release-dev` branch into `main` after a major feature i
- **Breaking Changes**: Clearly document any breaking changes in PR descriptions


### Auto Remove Stale Branches

Many stale branches lives in the repo and never got cleaned up. to balance developer convenience vs being organized/legible, we have implemented a CI workflow to identify and remove stable branches.

The CI workflow will:

- scan stale branches that not hv new commits since 90 days ago, and notify owner if there's one
- if still no changes coming in, delete the stable branch 7 days later

Following branches and regex are excluded

- `main`
- `release-dev/*` (release development branches)
- `v*.*.*` (release branches)

Regex rules can be changed by modifying `exempt-branches-regex` config in the [yml](https://github.com/Layr-Labs/eigenlayer-contracts/blob/main/.github/workflows/remove-stale-branches.yml)


------


## Release Management

Expand Down