Skip to content

All long-term branches should be covered by a branch protection rule #2765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
trask opened this issue May 20, 2025 · 1 comment
Open

All long-term branches should be covered by a branch protection rule #2765

trask opened this issue May 20, 2025 · 1 comment
Assignees

Comments

@trask
Copy link
Member

trask commented May 20, 2025

I think it's uncontroversial that all long-term branches should be covered by a branch protection rule, e.g. to at least ensure the branch cannot be accidentally deleted or force pushed to.

Different repos have different naming conventions for long-term branch names, which makes this is hard to audit and mitigate issues with unprotected long-term branches.

So instead I wrote a script to report all branches that aren't covered by any branch protection (other than the fallback **/** branch protection), which seems to be pretty close to what we want, other than a lot of old temporary branches that maybe should get cleaned up anyways(?).

(note: the **/** branch protection rule actually "helps" us in this effort since it has forced us to create separate branch protection rules for renovate/**/*, etc)

I'm planning to automatically create per-repo issues with the list of unprotected branches in that repo and reference back to this issue for further discussion / assistance.

I think once all branches are covered by a branch protection rule (other than the fallback **/**), we can (and should) allow deletions on the fallback **/** branch protection, which should alleviate an existing pain point.

@trask trask self-assigned this May 20, 2025
This was referenced May 21, 2025
@trask
Copy link
Member Author

trask commented May 21, 2025

To start with, I had the script open issues only on repos with less than 5 branches that weren't protected by branch protection rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant