Skip to content

Commit

Permalink
Set-GitHubRepository: Add Support for 'Web Commit Signoff Required' O…
Browse files Browse the repository at this point in the history
…ption

Adds the `WebCommitSignoffRequired` parameter to the `Set-GitHubRepository` function.

Fixes #388

References:

- https://docs.github.com/en/rest/repos/repos#update-a-repository
  • Loading branch information
X-Guardian committed Feb 27, 2023
1 parent 9baf54e commit 516be0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions GitHubRepositories.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,9 @@ filter Set-GitHubRepository
.PARAMETER IsTemplate
Specifies whether the repository is made available as a template.
.PARAMETER WebCommitSignoffRequired
Specifies whether to require contributors to sign off on web-based commits.
.PARAMETER Archived
Specify this to archive this repository.
NOTE: You cannot unarchive repositories through the API / this module.
Expand Down Expand Up @@ -1198,6 +1201,8 @@ filter Set-GitHubRepository

[switch] $IsTemplate,

[switch] $WebCommitSignoffRequired,

[switch] $Archived,

[switch] $Force,
Expand Down Expand Up @@ -1243,6 +1248,7 @@ filter Set-GitHubRepository
if ($PSBoundParameters.ContainsKey('AllowUpdateBranch')) { $hashBody['allow_update_branch'] = $AllowUpdateBranch.ToBool() }
if ($PSBoundParameters.ContainsKey('DeleteBranchOnMerge')) { $hashBody['delete_branch_on_merge'] = $DeleteBranchOnMerge.ToBool() }
if ($PSBoundParameters.ContainsKey('IsTemplate')) { $hashBody['is_template'] = $IsTemplate.ToBool() }
if ($PSBoundParameters.ContainsKey('WebCommitSignoffRequired')) { $hashBody['web_commit_signoff_required'] = $WebCommitSignoffRequired.ToBool() }
if ($PSBoundParameters.ContainsKey('Archived')) { $hashBody['archived'] = $Archived.ToBool() }

if ($Force -and (-not $Confirm))
Expand Down
2 changes: 2 additions & 0 deletions Tests/GitHubRepositories.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ Describe 'GitHubRepositories\Set-GitHubRepository' {
AllowUpdateBranch = $true
DeleteBranchOnMerge = $true
IsTemplate = $true
WebCommitSignoffRequired = $true
}

$updatedRepo = Set-GitHubRepository @updateGithubRepositoryParms -PassThru
Expand All @@ -809,6 +810,7 @@ Describe 'GitHubRepositories\Set-GitHubRepository' {
$updatedRepo.allow_update_branch | Should -BeTrue
$updatedRepo.delete_branch_on_merge | Should -BeTrue
$updatedRepo.is_template | Should -BeTrue
$updatedRepo.web_commit_signoff_required | Should -BeTrue
}
}

Expand Down

0 comments on commit 516be0b

Please sign in to comment.