Skip to content

Bug in Update-GitHubRepository Archived parameter usage #134

Closed
@amis92

Description

@amis92

So I'm pretty sure there's a bug in Update-GitHubRepository cmdlet - found it by just browsing source code:

if ($PSBoundParameters.ContainsKey('Archived')) { $hashBody['archived'] = (-not $Archived.ToBool()) }

Passing the Archived switch will result in archived=false parameter passed to API.

Is:
$hashBody['archived'] = (-not $Archived.ToBool())
Should be:
$hashBody['archived'] = $Archived.ToBool()

This is probably a copy-paste error since all other properties use inverted style:

if ($PSBoundParameters.ContainsKey('DisallowSquashMerge')) { $hashBody['allow_squash_merge'] = (-not $DisallowSquashMerge.ToBool()) }
if ($PSBoundParameters.ContainsKey('DisallowMergeCommit')) { $hashBody['allow_merge_commit'] = (-not $DisallowMergeCommit.ToBool()) }
if ($PSBoundParameters.ContainsKey('DisallowRebaseMerge')) { $hashBody['allow_rebase_merge'] = (-not $DisallowRebaseMerge.ToBool()) }
if ($PSBoundParameters.ContainsKey('Archived')) { $hashBody['archived'] = (-not $Archived.ToBool()) }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis relates to a bug in the existing module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions