microsoft / PowerShellForGitHub

Microsoft PowerShell wrapper for GitHub API
Other
588 stars 185 forks source link

Feature Request: Add The Ability to Create GitHub Repository Pattern Based Branch Protection Rules #312

Closed X-Guardian closed 3 years ago

X-Guardian commented 3 years ago

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 the release/**/* 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:

A new wrapper function Invoke-GHGraphQL would also need to be developed to call the GitHub GraphQL API.

Requested Assignment

HowardWolosky commented 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...