Skip to content

Commit add5797

Browse files
chore: capture initial branch policy settings (#1470)
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 ca482c6 commit add5797

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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-java-branch-protection
7+
description: Branch protection policy for the msgraph-sdk-java repository
8+
resource: repository
9+
configuration:
10+
branchProtectionRules:
11+
12+
- branchNamePattern: dev
13+
# This branch pattern applies to the following branches as of 06/12/2023 10:31:15:
14+
# dev
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: false
34+
# Are merge commits prohibited from being pushed to this branch. boolean
35+
requiresLinearHistory: false
36+
# 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
37+
requiredStatusChecks:
38+
- CodeQL
39+
- lint-api-level
40+
- license/cla
41+
- build
42+
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
43+
requiresStrictStatusChecks: false
44+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
45+
restrictsPushes: false
46+
# Restrict who can dismiss pull request reviews. boolean
47+
restrictsReviewDismissals: false
48+
49+
- branchNamePattern: feature/6.0
50+
# This branch pattern applies to the following branches as of 06/12/2023 10:31:15:
51+
# feature/6.0
52+
53+
# Specifies whether this branch can be deleted. boolean
54+
allowsDeletions: false
55+
# Specifies whether forced pushes are allowed on this branch. boolean
56+
allowsForcePushes: false
57+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
58+
dismissStaleReviews: true
59+
# Specifies whether admins can overwrite branch protection. boolean
60+
isAdminEnforced: false
61+
# Indicates whether "Require a pull request before merging" is enabled. boolean
62+
requiresPullRequestBeforeMerging: true
63+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
64+
requiredApprovingReviewsCount: 1
65+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
66+
requireCodeOwnersReview: true
67+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
68+
requiresCommitSignatures: false
69+
# Are conversations required to be resolved before merging? boolean
70+
requiresConversationResolution: false
71+
# Are merge commits prohibited from being pushed to this branch. boolean
72+
requiresLinearHistory: false
73+
# 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
74+
requiredStatusChecks:
75+
- CodeQL
76+
- lint-api-level
77+
- license/cla
78+
- build
79+
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
80+
requiresStrictStatusChecks: false
81+
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
82+
restrictsPushes: false
83+
# Restrict who can dismiss pull request reviews. boolean
84+
restrictsReviewDismissals: false
85+

0 commit comments

Comments
 (0)