Set-GitHubRelease¶
SYNOPSIS¶
Creates or updates a release.
SYNTAX¶
Not latest (Default)¶
Set-GitHubRelease -Owner <String> -Repository <String> -Tag <String> [-Target <String>] [-Name <String>]
[-Notes <String>] [-Draft] [-Prerelease] [-DiscussionCategoryName <String>] [-GenerateReleaseNotes]
[-Context <Object>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set latest¶
Set-GitHubRelease -Owner <String> -Repository <String> -Tag <String> [-Target <String>] [-Name <String>]
[-Notes <String>] [-DiscussionCategoryName <String>] [-GenerateReleaseNotes] [-Latest] [-Context <Object>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION¶
The Set-GitHubRelease cmdlet creates a new GitHub release or updates an existing one for a specified tag.
This function first checks if a release with the specified tag already exists: - If the release exists, it will update the existing release with the provided parameters - If the release doesn't exist, it will create a new release
You can specify whether the release is a draft or prerelease, generate release notes automatically, link a discussion to the release, and set a release as the latest for the repository.
When using the 'Latest' parameter, the release will be promoted from draft/prerelease status to a full release.
EXAMPLES¶
EXAMPLE 1¶
Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Target 'main' -Notes 'Release notes'
Creates a new release with tag 'v1.0.0' targeting the 'main' branch.
EXAMPLE 2¶
Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Notes 'Updated release notes'
Updates an existing release with tag 'v1.0.0' to have new release notes.
EXAMPLE 3¶
Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Draft
Creates or updates a release as a draft release.
EXAMPLE 4¶
Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Prerelease
Creates or updates a release as a prerelease.
EXAMPLE 5¶
Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -Latest
Sets the release with tag 'v1.0.0' as the latest release for the repository. If the release was a draft or prerelease, it will be promoted to a full release.
EXAMPLE 6¶
Set-GitHubRelease -Owner 'octocat' -Repository 'hello-world' -Tag 'v1.0.0' -GenerateReleaseNotes
Creates or updates a release with automatically generated release notes based on pull requests and commits.
EXAMPLE 7¶
Get-GitHubRepository -Owner 'octocat' -Repository 'hello-world' | Set-GitHubRelease -Tag 'v1.0.0' -Notes 'Release notes'
Creates or updates a release using pipeline input for the repository.
PARAMETERS¶
-Owner¶
The account owner of the repository. The name is not case sensitive.
Type: String
Parameter Sets: (All)
Aliases: Organization, User
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-Repository¶
The name of the repository without the .git extension. The name is not case sensitive.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-Tag¶
The name of the tag.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
-Target¶
Specifies the reference value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. API Default: the repository's default branch.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: Main
Accept pipeline input: False
Accept wildcard characters: False
-Name¶
The name of the release.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Notes¶
Text describing the contents of the tag.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Draft¶
Whether the release is a draft.
Type: SwitchParameter
Parameter Sets: Not latest
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Prerelease¶
Whether to identify the release as a prerelease.
Type: SwitchParameter
Parameter Sets: Not latest
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-DiscussionCategoryName¶
If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-GenerateReleaseNotes¶
Whether to automatically generate the name and body for this release. If name is specified, the specified name will be used; otherwise, a name will be automatically generated. If body is specified, the body will be pre-pended to the automatically generated notes.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Latest¶
Specifies whether this release should be set as the latest release for the repository. If the release is a draft or a prerelease, setting this parameters will promote the release to a release, setting the draft and prerelease parameters to false.
Type: SwitchParameter
Parameter Sets: Set latest
Aliases:
Required: True
Position: Named
Default value: False
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: Named
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¶
GitHubRelease¶
NOTES¶
RELATED LINKS¶
https://psmodule.io/GitHub/Functions/Releases/Set-GitHubRelease/