@@ -421,7 +421,7 @@ filter Set-GitHubRepositoryBranchProtectionRule
421
421
422
422
[string []] $RestrictPushApps ,
423
423
424
- [switch ]$RequireLinearHistory ,
424
+ [switch ] $RequireLinearHistory ,
425
425
426
426
[switch ] $AllowForcePushes ,
427
427
@@ -544,7 +544,8 @@ filter Set-GitHubRepositoryBranchProtectionRule
544
544
$hashBody [' allow_deletions' ] = $AllowDeletions.ToBool ()
545
545
}
546
546
547
- if ($PSCmdlet.ShouldProcess (" '$BranchName ' branch of repository '$RepositoryName '" ,
547
+ if ($PSCmdlet.ShouldProcess (
548
+ " '$BranchName ' branch of repository '$RepositoryName '" ,
548
549
' Set GitHub Repository Branch Protection' ))
549
550
{
550
551
Write-InvocationLog
@@ -777,7 +778,7 @@ filter Add-GitHubBranchProtectionRuleAdditionalProperties
777
778
[PSCustomObject []] $InputObject ,
778
779
779
780
[ValidateNotNullOrEmpty ()]
780
- [string ] $TypeName = $script :GitHubBranchTypeName
781
+ [string ] $TypeName = $script :GitHubBranchProtectionRuleName
781
782
)
782
783
783
784
foreach ($item in $InputObject )
@@ -792,9 +793,9 @@ filter Add-GitHubBranchProtectionRuleAdditionalProperties
792
793
793
794
$hostName = $ (Get-GitHubConfiguration - Name ' ApiHostName' )
794
795
795
- if ($item.html_url -match " ^https?://api. $hostName /repos/([^/]+)/?( [^/]+)/?( [^/]+)/? ([^/]+)?(?: /.*)? $" )
796
+ if ($item.html_url -match " ^https?://(?:www\.| api\.|) $hostName /repos/(?: [^/]+)/(?: [^/]+)/branches/ ([^/]+)/.*$" )
796
797
{
797
- $branchName = $Matches [4 ]
798
+ $branchName = $Matches [1 ]
798
799
}
799
800
else
800
801
{
0 commit comments