Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -1063,6 +1063,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 @@ -1163,6 +1166,8 @@ filter Set-GitHubRepository

[switch] $IsTemplate,

[switch] $WebCommitSignoffRequired,

[switch] $Archived,

[switch] $Force,
Expand Down Expand Up @@ -1205,6 +1210,7 @@ filter Set-GitHubRepository
if ($PSBoundParameters.ContainsKey('DisallowRebaseMerge')) { $hashBody['allow_rebase_merge'] = (-not $DisallowRebaseMerge.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 @@ -730,6 +730,7 @@ Describe 'GitHubRepositories\Set-GitHubRepository' {
DisallowRebaseMerge = $false
DeleteBranchOnMerge = $true
IsTemplate = $true
WebCommitSignoffRequired = $true
}

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

Expand Down