Skip to content

Commit

Permalink
Merge pull request #350 from microsoft/andrueastman/policyfile
Browse files Browse the repository at this point in the history
chore: add policy file for the repository
  • Loading branch information
andrueastman authored Oct 14, 2024
2 parents 2455818 + 62292b4 commit 8040917
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/policies/kiota-abstractions-python-branch-protection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

name: kiota-abstractions-python-branch-protection
description: Branch protection policy for the kiota-abstractions-python repository
resource: repository
configuration:
branchProtectionRules:
- branchNamePattern: main
# This branch pattern applies to the following branches as of 08/30/2023:
# main
# Specifies whether this branch can be deleted. boolean
allowsDeletions: false
# Specifies whether forced pushes are allowed on this branch. boolean
allowsForcePushes: false
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
dismissStaleReviews: true
# Specifies whether admins can overwrite branch protection. boolean
isAdminEnforced: false
# Indicates whether "Require a pull request before merging" is enabled. boolean
requiresPullRequestBeforeMerging: true
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
requiredApprovingReviewsCount: 1
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
requireCodeOwnersReview: true
# Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines.
requiresCommitSignatures: false
# Are conversations required to be resolved before merging? boolean
requiresConversationResolution: true
# Are merge commits prohibited from being pushed to this branch. boolean
requiresLinearHistory: false
# 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
requiredStatusChecks:
- check-python-version-matrix
- license/cla
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
requiresStrictStatusChecks: true
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
restrictsPushes: false
# Restrict who can dismiss pull request reviews. boolean
restrictsReviewDismissals: false
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,18 @@ jobs:
- name: Run the tests
run: |
pytest
# The check-python-version-matrix returns success if all matrix jobs in build are successful; otherwise, it returns a failure.
# Use this as a PR status check for GitHub Policy Service instead of individual matrix entry checks.
check-python-version-matrix:
runs-on: ubuntu-latest
needs: [build]
if: always()
steps:
- name: All build matrix options are successful
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: One or more build matrix options failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

0 comments on commit 8040917

Please sign in to comment.