From 2076fd8bd64c4aff2f8314b43347d5235c113e9d Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 29 May 2024 17:30:14 +1200 Subject: [PATCH] DOC Update branch protection rules --- .../09_Repository_Management.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/en/12_Project_Governance/09_Repository_Management.md b/en/12_Project_Governance/09_Repository_Management.md index 5c52b2478..dcce007bc 100644 --- a/en/12_Project_Governance/09_Repository_Management.md +++ b/en/12_Project_Governance/09_Repository_Management.md @@ -39,10 +39,24 @@ Some actions are restricted to avoid bad actors or accidental mistakes from caus If any exceptions to these rules need to be made for any reason, each exception must be approved in writing by the Silverstripe CMS Product Owner and only apply for a specified amount of time. -#### Deleting branches +#### Branch protection rules + +##### Updating branch and tag protection rulesets + +Use the `rulesets` command in [silverstripe/module-standardiser](https://github.com/silverstripe/module-standardiser) to add and update the branch and tag protection rulesets for all support modules via the GitHub API. + +These rulesets restrict non-admins from various activities such as merging pull-requests without a review, creating branches, and pushing tags. + +##### Updating branch protection rule A branch protection rule to protect against deleting branches is added by going to `https://github.com/silverstripe//settings/branches`, clicking "Add rule", inputting `[0-9]*` as the branch name pattern, and clicking create (without checking any of the checkboxes). +There is no REST API endpoint available to add this rule with a pattern, so it must be done manually. + +The rule is used in additional to the branch ruleset to remove the ability for admins to bypass deleting protected branches. + +#### Deleting branches + Any branches following the documented naming convention cannot be deleted by anyone. If a branch following that naming convention is created by mistake, a Core Committer can rename and then delete the branch.