Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -1081,6 +1081,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 @@ -1185,6 +1188,8 @@ filter Set-GitHubRepository

[switch] $IsTemplate,

[switch] $WebCommitSignoffRequired,

[switch] $Archived,

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

$updatedRepo = Set-GitHubRepository @updateGithubRepositoryParms -PassThru
Expand All @@ -805,6 +806,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