Skip to content

Commit

Permalink
Merge pull request #522 from creative-commoners/pulls/5.2/repo-manage…
Browse files Browse the repository at this point in the history
…ment

DOC Update branch protection rules
  • Loading branch information
GuySartorelli authored May 29, 2024
2 parents e36a8ce + 2076fd8 commit 71c4876
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion en/12_Project_Governance/09_Repository_Management.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<repository>/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.
Expand Down

0 comments on commit 71c4876

Please sign in to comment.