Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 29 additions & 35 deletions .github/policies/msgraph-sdk-javascript-branch-protection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ configuration:
branchProtectionRules:

- branchNamePattern: dev
# This branch pattern applies to the following branches as of 06/12/2023 10:31:16:
# This branch pattern applies to the following branches as of 08/30/2023:
# dev

# Specifies whether this branch can be deleted. boolean
Expand All @@ -30,14 +30,13 @@ configuration:
# 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: false
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:
- build (16.x)
- build (18.x)
- build (20.x)
- check-build-matrix
- CodeQL
# 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.
Expand All @@ -46,7 +45,7 @@ configuration:
restrictsReviewDismissals: false

- branchNamePattern: master
# This branch pattern applies to the following branches as of 06/12/2023 10:31:16:
# This branch pattern applies to the following branches as of 08/30/2023:
# master

# Specifies whether this branch can be deleted. boolean
Expand All @@ -66,14 +65,13 @@ configuration:
# 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: false
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:
- build (16.x)
- build (18.x)
- build (20.x)
- check-build-matrix
- CodeQL
# 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.
Expand All @@ -82,30 +80,29 @@ configuration:
restrictsReviewDismissals: false

- branchNamePattern: 3.0.0
# This branch pattern applies to the following branches as of 06/12/2023 10:31:16:
# This branch pattern applies to the following branches as of 08/30/2023:
# 3.0.0

# 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: false
dismissStaleReviews: true
# Specifies whether admins can overwrite branch protection. boolean
isAdminEnforced: false
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
requireCodeOwnersReview: false
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: false
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:
- build (16.x)
- build (18.x)
- build (20.x)
- check-build-matrix
- CodeQL
# 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.
Expand All @@ -114,34 +111,33 @@ configuration:
restrictsReviewDismissals: false

- branchNamePattern: support/v2
# This branch pattern applies to the following branches as of 06/12/2023 10:31:16:
# This branch pattern applies to the following branches as of 08/30/2023:
# support/v2

# 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: false
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: false
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: false
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:
- build (16.x)
- build (18.x)
- build (20.x)
- check-build-matrix
- CodeQL
# 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.
Expand All @@ -150,7 +146,7 @@ configuration:
restrictsReviewDismissals: false

- branchNamePattern: v2/dev
# This branch pattern applies to the following branches as of 06/12/2023 10:31:16:
# This branch pattern applies to the following branches as of 08/30/2023:
# v2/dev

# Specifies whether this branch can be deleted. boolean
Expand All @@ -175,9 +171,8 @@ configuration:
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:
- build (16.x)
- build (18.x)
- build (20.x)
- check-build-matrix
- CodeQL
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
requiresStrictStatusChecks: false
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
Expand All @@ -186,34 +181,33 @@ configuration:
restrictsReviewDismissals: false

- branchNamePattern: main
# This branch pattern applies to the following branches as of 06/12/2023 10:31:16:
# 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: false
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: false
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: false
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:
- build (16.x)
- build (18.x)
- build (20.x)
- check-build-matrix
- CodeQL
# 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.
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/ci_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci

- name: Build for node 16, 18 & 20
run: npm run build

- name: Run unit tests
run: npm test

Expand All @@ -33,3 +33,17 @@ jobs:
run: |
npm ci
npm test

# The check-build-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-build-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