Граф коммитов

1 Коммитов

Автор SHA1 Сообщение Дата
Simon Heather f7efc4a036
GitHubBranches: Add Get/New/Remove GitHub Repository Branch Pattern Protection 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)
2021-07-15 08:43:15 -07:00