Skip to content

Commit

Permalink
Merge pull request #1820 from microsoftgraph/rsh/supportBranch-protec…
Browse files Browse the repository at this point in the history
…tion

Support Branch Protection
  • Loading branch information
ramsessanchez authored Feb 20, 2024
2 parents aca3393 + d13765a commit 3590a56
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 10 deletions.
36 changes: 36 additions & 0 deletions .github/policies/msgraph-sdk-java-branch-protection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,39 @@ configuration:
# Restrict who can dismiss pull request reviews. boolean
restrictsReviewDismissals: false

- branchNamePattern: support/5.x.x
# This branch pattern applies to the following branches as of 02/14/2024 12:26
# dev

# 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:
- Analyze (java)
- lint-api-level
- license/cla
- build
# 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
4 changes: 2 additions & 2 deletions .github/workflows/api-level-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: "Checks the SDK only using APIs from the targeted API level"
on:
workflow_dispatch:
push:
branches: [ dev ]
branches: [dev, support/5.x.x]
pull_request:
branches: [ dev ]
branches: [dev, support/5.x.x]

jobs:
lint-api-level:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ dev ]
branches: [dev, support/5.x.x]
pull_request:
# The branches below must be a subset of the branches above
branches: [ dev ]
branches: [dev, support/5.x.x]
schedule:
- cron: '0 1 * * 4'
workflow_dispatch:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/conflicting-pr-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ name: PullRequestConflicting
# events but only for the master branch
on:
push:
branches: [ master, dev ]
branches: [master, dev, support/5.x.x]
pull_request:
types: [synchronize]
branches: [ master, dev ]
branches: [master, dev, support/5.x.x]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Gradle Build and Compare Package

on:
push:
branches: [ dev ]
branches: [dev, support/5.x.x]
pull_request:
branches: [ dev ]
branches: [dev, support/5.x.x]
paths-ignore:
- '.gradle/wrapper'
- '.gitignore'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/preview-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Maven Preview/Release and Github Release

on:
push:
branches: [ dev ]
branches: [dev, support/5.x.x]
paths-ignore:
- '.gradle/wrapper'
- '.gitignore'
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
run: ./gradlew $PREVIEW_TASK

maven_Release:
if: ${{ github.ref == 'refs/heads/dev' }}
if: ${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/support/5.x.x' }}
environment:
name: maven_central_release
runs-on: ubuntu-latest
Expand Down

0 comments on commit 3590a56

Please sign in to comment.