Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-GitHubRepository: Add Support for 'Web Commit Signoff Required' Option #389

Merged
merged 3 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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