Skip to content

Commit d98b823

Browse files
chore: capture all branch protection policy (#2430)
* chore: capture all branch protection policy * wrap pattern in quotes
1 parent 00b68e6 commit d98b823

File tree

2 files changed

+194
-31
lines changed

2 files changed

+194
-31
lines changed

.github/policies/branch-protection.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# File initially created using https://github.com/MIchaelMainer/policyservicetoolkit/blob/main/branch_protection_export.ps1.
5+
6+
name: microsoft-graph-toolkit-branch-protection
7+
description: Branch protection policy for the microsoft-graph-toolkit repository
8+
resource: repository
9+
configuration:
10+
branchProtectionRules:
11+
12+
- branchNamePattern: main
13+
# This branch pattern applies to the following branches as of 06/09/2023 14:08:40:
14+
# main
15+
16+
# Specifies whether this branch can be deleted. boolean
17+
allowsDeletions: false
18+
# Specifies whether forced pushes are allowed on this branch. boolean
19+
allowsForcePushes: false
20+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
21+
dismissStaleReviews: true
22+
# Specifies whether admins can overwrite branch protection. boolean
23+
isAdminEnforced: false
24+
# Indicates whether "Require a pull request before merging" is enabled. boolean
25+
requiresPullRequestBeforeMerging: true
26+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
27+
requiredApprovingReviewsCount: 1
28+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
29+
requireCodeOwnersReview: true
30+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
31+
requiresCommitSignatures: false
32+
# Are conversations required to be resolved before merging? boolean
33+
requiresConversationResolution: true
34+
# Are merge commits prohibited from being pushed to this branch. boolean
35+
requiresLinearHistory: false
36+
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
37+
requiresStrictStatusChecks: true
38+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
39+
restrictsPushes: false
40+
# Restrict who can dismiss pull request reviews. boolean
41+
restrictsReviewDismissals: false
42+
43+
- branchNamePattern: master
44+
# This branch pattern does not apply to any currently existent branches as of 06/09/2023 14:08:40.
45+
46+
# Specifies whether this branch can be deleted. boolean
47+
allowsDeletions: false
48+
# Specifies whether forced pushes are allowed on this branch. boolean
49+
allowsForcePushes: false
50+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
51+
dismissStaleReviews: true
52+
# Specifies whether admins can overwrite branch protection. boolean
53+
isAdminEnforced: false
54+
# Indicates whether "Require a pull request before merging" is enabled. boolean
55+
requiresPullRequestBeforeMerging: true
56+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
57+
requiredApprovingReviewsCount: 1
58+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
59+
requireCodeOwnersReview: true
60+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
61+
requiresCommitSignatures: false
62+
# Are conversations required to be resolved before merging? boolean
63+
requiresConversationResolution: true
64+
# Are merge commits prohibited from being pushed to this branch. boolean
65+
requiresLinearHistory: false
66+
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
67+
requiresStrictStatusChecks: true
68+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
69+
restrictsPushes: false
70+
# Restrict who can dismiss pull request reviews. boolean
71+
restrictsReviewDismissals: false
72+
73+
- branchNamePattern: dev
74+
# This branch pattern does not apply to any currently existent branches as of 06/09/2023 14:08:40.
75+
76+
# Specifies whether this branch can be deleted. boolean
77+
allowsDeletions: false
78+
# Specifies whether forced pushes are allowed on this branch. boolean
79+
allowsForcePushes: false
80+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
81+
dismissStaleReviews: true
82+
# Specifies whether admins can overwrite branch protection. boolean
83+
isAdminEnforced: false
84+
# Indicates whether "Require a pull request before merging" is enabled. boolean
85+
requiresPullRequestBeforeMerging: true
86+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
87+
requiredApprovingReviewsCount: 1
88+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
89+
requireCodeOwnersReview: true
90+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
91+
requiresCommitSignatures: false
92+
# Are conversations required to be resolved before merging? boolean
93+
requiresConversationResolution: true
94+
# Are merge commits prohibited from being pushed to this branch. boolean
95+
requiresLinearHistory: false
96+
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
97+
requiresStrictStatusChecks: true
98+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
99+
restrictsPushes: false
100+
# Restrict who can dismiss pull request reviews. boolean
101+
restrictsReviewDismissals: false
102+
103+
- branchNamePattern: '[Rr]elease/*'
104+
# This branch pattern applies to the following branches as of 06/09/2023 14:08:40:
105+
# release/latest
106+
# release/merge
107+
# release/v2.10.0
108+
# release/1.x
109+
110+
# Specifies whether this branch can be deleted. boolean
111+
allowsDeletions: false
112+
# Specifies whether forced pushes are allowed on this branch. boolean
113+
allowsForcePushes: false
114+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
115+
dismissStaleReviews: true
116+
# Specifies whether admins can overwrite branch protection. boolean
117+
isAdminEnforced: false
118+
# Indicates whether "Require a pull request before merging" is enabled. boolean
119+
requiresPullRequestBeforeMerging: true
120+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
121+
requiredApprovingReviewsCount: 1
122+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
123+
requireCodeOwnersReview: true
124+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
125+
requiresCommitSignatures: false
126+
# Are conversations required to be resolved before merging? boolean
127+
requiresConversationResolution: true
128+
# Are merge commits prohibited from being pushed to this branch. boolean
129+
requiresLinearHistory: false
130+
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
131+
requiresStrictStatusChecks: true
132+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
133+
restrictsPushes: false
134+
# Restrict who can dismiss pull request reviews. boolean
135+
restrictsReviewDismissals: false
136+
137+
- branchNamePattern: next/*
138+
# This branch pattern applies to the following branches as of 06/09/2023 14:08:40:
139+
# next/dark-toggle
140+
# next/disambiguation-util-fixes
141+
# next/docs-add-version-info
142+
# next/enhanced-file-list
143+
# next/file-picker
144+
# next/fix-grid
145+
# next/fix-msal2-provider
146+
# next/fix-people-picker-flyout-a11y
147+
# next/fluent-deps
148+
# next/fluentui
149+
# next/groupTypePhoto
150+
# next/groupTypeTest
151+
# next/lit-element-update
152+
# next/login-design
153+
# next/merge
154+
# next/mgt-chat
155+
# next/node16-support
156+
# next/preview-pipeline
157+
# next/teamsfx
158+
# next/wc-registration
159+
# next/wc-registration-samples
160+
# next/wc-registration-utils
161+
# next/wip
162+
163+
# Specifies whether this branch can be deleted. boolean
164+
allowsDeletions: false
165+
# Specifies whether forced pushes are allowed on this branch. boolean
166+
allowsForcePushes: false
167+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
168+
dismissStaleReviews: true
169+
# Specifies whether admins can overwrite branch protection. boolean
170+
isAdminEnforced: false
171+
# Indicates whether "Require a pull request before merging" is enabled. boolean
172+
requiresPullRequestBeforeMerging: true
173+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
174+
requiredApprovingReviewsCount: 1
175+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
176+
requireCodeOwnersReview: true
177+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
178+
requiresCommitSignatures: false
179+
# Are conversations required to be resolved before merging? boolean
180+
requiresConversationResolution: true
181+
# Are merge commits prohibited from being pushed to this branch. boolean
182+
requiresLinearHistory: false
183+
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
184+
requiredStatusChecks:
185+
- GitOps/AdvancedSecurity
186+
- license/cla
187+
- check-build-matrix
188+
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
189+
requiresStrictStatusChecks: true
190+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
191+
restrictsPushes: false
192+
# Restrict who can dismiss pull request reviews. boolean
193+
restrictsReviewDismissals: false
194+

0 commit comments

Comments
 (0)