Skip to content

Commit 3590a56

Browse files
Merge pull request #1820 from microsoftgraph/rsh/supportBranch-protection
Support Branch Protection
2 parents aca3393 + d13765a commit 3590a56

File tree

6 files changed

+46
-10
lines changed

6 files changed

+46
-10
lines changed

.github/policies/msgraph-sdk-java-branch-protection.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,39 @@ configuration:
4646
# Restrict who can dismiss pull request reviews. boolean
4747
restrictsReviewDismissals: false
4848

49+
- branchNamePattern: support/5.x.x
50+
# This branch pattern applies to the following branches as of 02/14/2024 12:26
51+
# dev
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: true
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+
- Analyze (java)
76+
- lint-api-level
77+
- license/cla
78+
- build
79+
# Require branches to be up to date before merging. Requires requiredStatusChecks. boolean
80+
requiresStrictStatusChecks: true
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

.github/workflows/api-level-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: "Checks the SDK only using APIs from the targeted API level"
33
on:
44
workflow_dispatch:
55
push:
6-
branches: [ dev ]
6+
branches: [dev, support/5.x.x]
77
pull_request:
8-
branches: [ dev ]
8+
branches: [dev, support/5.x.x]
99

1010
jobs:
1111
lint-api-level:

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ dev ]
16+
branches: [dev, support/5.x.x]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ dev ]
19+
branches: [dev, support/5.x.x]
2020
schedule:
2121
- cron: '0 1 * * 4'
2222
workflow_dispatch:

.github/workflows/conflicting-pr-label.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ name: PullRequestConflicting
66
# events but only for the master branch
77
on:
88
push:
9-
branches: [ master, dev ]
9+
branches: [master, dev, support/5.x.x]
1010
pull_request:
1111
types: [synchronize]
12-
branches: [ master, dev ]
12+
branches: [master, dev, support/5.x.x]
1313

1414
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1515
jobs:

.github/workflows/gradle-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Gradle Build and Compare Package
22

33
on:
44
push:
5-
branches: [ dev ]
5+
branches: [dev, support/5.x.x]
66
pull_request:
7-
branches: [ dev ]
7+
branches: [dev, support/5.x.x]
88
paths-ignore:
99
- '.gradle/wrapper'
1010
- '.gitignore'

.github/workflows/preview-and-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Maven Preview/Release and Github Release
22

33
on:
44
push:
5-
branches: [ dev ]
5+
branches: [dev, support/5.x.x]
66
paths-ignore:
77
- '.gradle/wrapper'
88
- '.gitignore'
@@ -49,7 +49,7 @@ jobs:
4949
run: ./gradlew $PREVIEW_TASK
5050

5151
maven_Release:
52-
if: ${{ github.ref == 'refs/heads/dev' }}
52+
if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/support/5.x.x' }}
5353
environment:
5454
name: maven_central_release
5555
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)