Skip to content

Commit 62292b4

Browse files
author
Andrew Omondi
committed
chore: add policy file for the repository
1 parent 2455818 commit 62292b4

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
name: kiota-abstractions-python-branch-protection
5+
description: Branch protection policy for the kiota-abstractions-python repository
6+
resource: repository
7+
configuration:
8+
branchProtectionRules:
9+
- branchNamePattern: main
10+
# This branch pattern applies to the following branches as of 08/30/2023:
11+
# main
12+
# Specifies whether this branch can be deleted. boolean
13+
allowsDeletions: false
14+
# Specifies whether forced pushes are allowed on this branch. boolean
15+
allowsForcePushes: false
16+
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
17+
dismissStaleReviews: true
18+
# Specifies whether admins can overwrite branch protection. boolean
19+
isAdminEnforced: false
20+
# Indicates whether "Require a pull request before merging" is enabled. boolean
21+
requiresPullRequestBeforeMerging: true
22+
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
23+
requiredApprovingReviewsCount: 1
24+
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
25+
requireCodeOwnersReview: true
26+
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
27+
requiresCommitSignatures: false
28+
# Are conversations required to be resolved before merging? boolean
29+
requiresConversationResolution: true
30+
# Are merge commits prohibited from being pushed to this branch. boolean
31+
requiresLinearHistory: false
32+
# 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
33+
requiredStatusChecks:
34+
- check-python-version-matrix
35+
- license/cla
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

.github/workflows/build.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,18 @@ jobs:
4545
- name: Run the tests
4646
run: |
4747
pytest
48+
49+
50+
# The check-python-version-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure.
51+
# Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks.
52+
check-python-version-matrix:
53+
runs-on: ubuntu-latest
54+
needs: [build]
55+
if: always()
56+
steps:
57+
- name: All build matrix options are successful
58+
if: ${{ !(contains(needs.*.result, 'failure')) }}
59+
run: exit 0
60+
- name: One or more build matrix options failed
61+
if: ${{ contains(needs.*.result, 'failure') }}
62+
run: exit 1

0 commit comments

Comments
 (0)