Is it possible to enforce certain settings for all new repos such as which teams have access and branch rules requiring PRs to merge to master?
Hiya @sdmattheww, Welcome to the Community! You can customize access to each repository in your organization with granular permission levels, giving people access to the features and tasks they need. And with Branch protection rules you can enforce certain workflows or requirements before a collaborator can push changes to a branch in your repository, including merging a pull request into the branch, by creating a branch protection rule.
For more information on how set up default permissions and branch protection rules, check out this links: https://docs.github.com/en/github/administering-a-repository/managing-teams-and-people-with-access-to-your-repository; Managing a branch protection rule - GitHub Docs
I hope this helps!
Thanks! Is it possible to set parameters such as branch protection as defaults for all new repos? I’d like to be sure that I have branch protection in place as soon as I create a new repo.
@andreagriffiths11 Like @sdmattheww I too am interested in having branch protection rules in place by default, and also enforcing them on an organization level. My use-case is an inner source approach, so that all ‘internal’ repositories allow organization members to create feature branches without touching the protected branches.
The current GitHub settings are a real barrier to mass collaboration within organizations, with people having to request repo access on a daily basis. I noticed the recommendation of a settings bot in a different thread: Set branch protection to "default" branches - #8 by StellaAthena but that is defined on a per-repo, so it is difficult to scale and is error-prone. I’m quite disappointed this issue has been raised repeatedly for over 5 years and yet GitHub has not offered a real solution for this use-case. We’re currently contemplating writing our own bot to work around this issue.