Skip to content

Commit 64b1c36

Browse files
ci: add github branch policy definition (#2176)
* chore/add github branch policy definition * fix/yml encoding * Apply suggestions from code review --------- Co-authored-by: Vincent Biret <[email protected]>
1 parent 0bfa681 commit 64b1c36

File tree

1 file changed

+83
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)