Skip to content

Update-GitHubRepository

SYNOPSIS

Update a repository

SYNTAX

Update-GitHubRepository [[-Owner] <String>] [-Name] <String> [[-NewName] <String>] [[-Visibility] <String>]
 [[-Description] <String>] [[-Homepage] <Uri>] [[-IsArchived] <Boolean>] [[-IsTemplate] <Boolean>]
 [[-WebCommitSignoffRequired] <Boolean>] [[-DefaultBranch] <String>] [[-HasWiki] <Boolean>]
 [[-HasIssues] <Boolean>] [[-AllowForking] <Boolean>] [[-HasSponsorships] <Boolean>]
 [[-HasDiscussions] <Boolean>] [[-HasProjects] <Boolean>] [[-AllowMergeCommitWith] <String>]
 [[-AllowSquashMergingWith] <String>] [-AllowRebaseMerging] [[-SuggestUpdateBranch] <Boolean>]
 [[-AllowAutoMerge] <Boolean>] [[-DeleteBranchOnMerge] <Boolean>] [[-EnableAdvancedSecurity] <Boolean>]
 [[-EnableCodeSecurity] <Boolean>] [[-EnableSecretScanning] <Boolean>]
 [[-EnableSecretScanningPushProtection] <Boolean>] [[-EnableSecretScanningAIDetection] <Boolean>]
 [[-EnableSecretScanningNonProviderPatterns] <Boolean>] [[-Context] <Object>]
 [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Note: To edit a repository's topics, use the Replace all repository topics endpoint.

EXAMPLES

EXAMPLE 1

Update-GitHubRepository -Name 'octocat' -Description 'Hello-World' -Homepage 'https://github.com'

EXAMPLE 2

$params = @{
    Owner       = 'octocat'
    Name        = 'Hello-World'
    NewName     = 'Hello-World-Repository'
    Description = 'This is your first repository'
    Homepage    = 'https://github.com'
}
Update-GitHubRepository @params

PARAMETERS

-Owner

The account owner of the repository. The name is not case sensitive.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Name

The name of the repository without the .git extension. The name is not case sensitive.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-NewName

The name of the repository.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Visibility

The visibility of the repository.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Description

A short description of the repository.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Homepage

A URL with more information about the repository.

Type: Uri
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-IsArchived

Whether to archive this repository. false will unarchive a previously archived repository.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-IsTemplate

Whether this repository acts as a template that can be used to generate new repositories.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WebCommitSignoffRequired

Whether to require contributors to sign off on web-based commits.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DefaultBranch

Updates the default branch for this repository.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-HasWiki

Whether the wiki is enabled.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 11
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-HasIssues

Whether issues are enabled.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 12
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AllowForking

Either true to allow private forks, or false to prevent private forks.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 13
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-HasSponsorships

Whether sponsorships are enabled.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 14
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-HasDiscussions

Whether discussions are enabled.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 15
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-HasProjects

Whether projects are enabled.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 16
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AllowMergeCommitWith

Allow merge commits for pull requests with the specified setting.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 17
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AllowSquashMergingWith

Allow squash merges for pull requests with the specified setting.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 18
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AllowRebaseMerging

Whether to allow rebase merges for pull requests.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-SuggestUpdateBranch

Whether to always suggest to update a head branch that is behind its base branch during a pull request.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 19
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-AllowAutoMerge

Whether to allow Auto-merge to be used on pull requests.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 20
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DeleteBranchOnMerge

Whether to delete head branches when pull requests are merged

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 21
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-EnableAdvancedSecurity

Whether to enable GitHub Advanced Security for this repository.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 22
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-EnableCodeSecurity

Whether to enable code security for this repository.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 23
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-EnableSecretScanning

Whether to enable secret scanning for this repository.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 24
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-EnableSecretScanningPushProtection

Whether to enable secret scanning push protection for this repository.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 25
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-EnableSecretScanningAIDetection

Whether to enable secret scanning AI detection for this repository.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 26
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-EnableSecretScanningNonProviderPatterns

Whether to enable secret scanning non-provider patterns for this repository.

Type: Boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: 27
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Context

The context to run the command in. Used to get the details for the API call. Can be either a string or a GitHubContext object.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: 28
Default value: (Get-GitHubContext)
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

GitHubRepository

OUTPUTS

GitHubRepository

NOTES

Update a repository

https://psmodule.io/GitHub/Functions/Repositories/Update-GitHubRepository/