Feature #33
closedEnable automatic branch deletion after PR merges for all repositories
0%
conversation:26
Description
### Problem
Currently, when a pull request (PR) is merged in any repository, the associated branch remains in the repository. This leads to clutter and requires manual cleanup, which is inefficient and error-prone.
### Context
The client wants to automate branch deletion for **all repositories** under their organization. The requirement is to delete branches **only after they are merged via a PR** (not direct merges) and **exclude long-lived branches** (`main`, `master`, `dev`, `develop`, `preprod`, etc.). Most code hosting platforms (e.g., GitHub, GitLab) support this as a built-in setting.
### Proposed Behaviour
- Automatically delete branches after they are merged via a PR in all repositories.
- Exclude long-lived branches from deletion.
- Ensure the setting is applied consistently across the organization.
## Acceptance criteria
- [ ] Branches merged via PR are automatically deleted in all repositories.
- [ ] Long-lived branches (`main`, `master`, `dev`, `develop`, `preprod`, etc.) are **not** deleted.
- [ ] The setting is enabled at the organization level (or repository level if organization-wide is not possible).
- [ ] Direct merges (non-PR) do not trigger branch deletion.
- [ ] Verify the behaviour in a test repository before rolling out to all repositories.