Closed X-Guardian closed 3 years ago
@X-Guardian -- If you're willing to put the time and effort into writing it, I'll put in the time to review it. I took a look at the branchprotectionrule
object, and it's quite large. That's definitely going to be a lengthy parameter list...
Feature Idea Summary
The current
GitHubRepositoryBranchProtectionRule
functions do not allow the management of GitHub repository pattern based branch protection rules. e.g. a branch protection rule for all branches matching therelease/**/*
pattern. This is due to a limitation in the GitHub REST API in that the REST branch protection APIs do not support branch patterns.The GitHub GraphQL createbranchprotectionrule and deletebranchprotectionrule APIs do support branch patterns, so functions could be built to achieve this using these these GraphQL APIs.
Feature Idea Additional Details
Create the following additional functions that use the GraphQL API:
New-GitHubRepositoryBranchPatternProtectionRule
Get-GitHubRepositoryBranchPatternProtectionRule
Remove-GitHubRepositoryBranchPatternProtectionRule
A new wrapper function
Invoke-GHGraphQL
would also need to be developed to call the GitHub GraphQL API.Requested Assignment