diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml new file mode 100644 index 000000000..9f09c8b23 --- /dev/null +++ b/.github/workflows/remove-stale-branches.yml @@ -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/remove-stale-branches@v1.6.0 + 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" diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 3549e96b8..4df7aa40a 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -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