Skip to content

Commit 1822073

Browse files
chore: capture initial branch policy settings (#2083)
Capture current policy state so that we can make versioned changes to branch protection policies. This will enable policy history, auditing, review, standardization, and templatization. We will update policy in later PR. We can ignore the rule that states: `At least one value under RequiredStatusChecks must be specified when RequiresStrictStatusChecks is true.` or `RequiresStrictStatusChecks must be true when specifying RequiredStatusChecks.` This is getting removed. This is getting removed. * https://github.com/microsoft/GitOps.Branches/pull/73 * https://github.com/microsoft/GitOps.Branches/issues/72 This branch protection policy will not take effect until https://github.com/microsoftgraph/.github/blob/main/policies/branch-protection-sdks.yml has been removed.
1 parent 7abcd47 commit 1822073

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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: msgraph-sdk-powershell-branch-protection
7+
description: Branch protection policy for the msgraph-sdk-powershell repository
8+
resource: repository
9+
configuration:
10+
branchProtectionRules:
11+
12+
- branchNamePattern: main
13+
# This branch pattern applies to the following branches as of 06/12/2023 10:31:18:
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: false
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: false
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: false
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: dev
44+
# This branch pattern applies to the following branches as of 06/12/2023 10:31:18:
45+
# dev
46+
47+
# Specifies whether this branch can be deleted. boolean
48+
allowsDeletions: false
49+
# Specifies whether forced pushes are allowed on this branch. boolean
50+
allowsForcePushes: false
51+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
52+
dismissStaleReviews: true
53+
# Specifies whether admins can overwrite branch protection. boolean
54+
isAdminEnforced: false
55+
# Indicates whether "Require a pull request before merging" is enabled. boolean
56+
requiresPullRequestBeforeMerging: true
57+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
58+
requiredApprovingReviewsCount: 1
59+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
60+
requireCodeOwnersReview: true
61+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
62+
requiresCommitSignatures: false
63+
# Are conversations required to be resolved before merging? boolean
64+
requiresConversationResolution: false
65+
# Are merge commits prohibited from being pushed to this branch. boolean
66+
requiresLinearHistory: false
67+
# 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
68+
requiredStatusChecks:
69+
- license/cla
70+
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
71+
requiresStrictStatusChecks: true
72+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
73+
restrictsPushes: false
74+
# Restrict who can dismiss pull request reviews. boolean
75+
restrictsReviewDismissals: false
76+
77+
- branchNamePattern: features/[0-9]*
78+
# This branch pattern applies to the following branches as of 06/12/2023 10:31:18:
79+
# features/2.0
80+
81+
# Specifies whether this branch can be deleted. boolean
82+
allowsDeletions: false
83+
# Specifies whether forced pushes are allowed on this branch. boolean
84+
allowsForcePushes: false
85+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
86+
dismissStaleReviews: true
87+
# Specifies whether admins can overwrite branch protection. boolean
88+
isAdminEnforced: false
89+
# Indicates whether "Require a pull request before merging" is enabled. boolean
90+
requiresPullRequestBeforeMerging: true
91+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
92+
requiredApprovingReviewsCount: 1
93+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
94+
requireCodeOwnersReview: false
95+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
96+
requiresCommitSignatures: false
97+
# Are conversations required to be resolved before merging? boolean
98+
requiresConversationResolution: false
99+
# Are merge commits prohibited from being pushed to this branch. boolean
100+
requiresLinearHistory: false
101+
# 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
102+
requiredStatusChecks:
103+
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
104+
requiresStrictStatusChecks: true
105+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
106+
restrictsPushes: false
107+
# Restrict who can dismiss pull request reviews. boolean
108+
restrictsReviewDismissals: false
109+

0 commit comments

Comments
 (0)