Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHubBranches: Add Get/New/Remove GitHub Repository Branch Pattern P…
…rotection Rule (#313) Adds the following functions to the `GitHubBranches` module: * `Invoke-GHGraphQl` * `Get-GitHubRepositoryBranchPatternProtectionRule` * `New-GitHubRepositoryBranchPatternProtectionRule` * `Remove-GitHubRepositoryBranchPatternProtectionRule` `Invoke-GHGraphQl` is based on `Invoke-GHRestMethod` but modified with the following features: * Use of the GitHub GraphQL API Endpoint. * PowerShell 5 and 6+ `Invoke-WebRequest` error handling support. * Use of `ThrowTerminatingError` instead of `Throw` for enhanced exceptions and hiding the internal details of the function. Reference: [Everything you wanted to know about exceptions](https://docs.microsoft.com/en-us/powershell/scripting/learn/deep-dives/everything-about-exceptions) * GraphQl specific error handling. * Extensive debug logging. Fixes #312 References * [createbranchprotectionrule](https://docs.github.com/en/graphql/reference/mutations#createbranchprotectionrule) * [deletebranchprotectionrule](https://docs.github.com/en/graphql/reference/mutations#deletebranchprotectionrule) * [branchprotectionrule](https://docs.github.com/en/graphql/reference/objects#branchprotectionrule)
- Loading branch information