Skip to content

New‑SamplerGitHubReleaseTag

viscalyxbot edited this page Sep 30, 2025 · 2 revisions

SYNOPSIS

Creates a new GitHub release tag for the Sampler project.

SYNTAX

New-SamplerGitHubReleaseTag [[-DefaultBranchName] <String>] [[-UpstreamRemoteName] <String>]
 [[-ReleaseTag] <String>] [-ReturnToCurrentBranch] [-PushTag] [-Force] 
 [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The New-SamplerGitHubReleaseTag function creates a new release tag for the Sampler project on GitHub. It performs the following steps:

Checks if the remote specified in $UpstreamRemoteName exists locally and throws an error if it doesn't. 2. Fetches the $DefaultBranchName branch from the $UpstreamRemoteName remote and throws an error if it doesn't exist. 3. Checks out the $DefaultBranchName branch. 4. Fetches the $DefaultBranchName branch from the $UpstreamRemoteName remote. 5. Rebases the local $DefaultBranchName branch with the $UpstreamRemoteName/$DefaultBranchName branch. 6. Gets the last commit ID of the $DefaultBranchName branch. 7. Fetches tags from the $UpstreamRemoteName remote. 8. If no release tag is specified, it checks if there are any tags in the local repository and selects the latest preview tag. 9. Creates a new tag with the specified release tag or based on the latest preview tag. 10. Optionally pushes the tag to the $UpstreamRemoteName remote. 11. Switches back to the previous branch if requested.

EXAMPLES

EXAMPLE 1

New-SamplerGitHubReleaseTag -ReleaseTag 'v1.0.0' -PushTag

Creates a new release tag with the specified tag 'v1.0.0' and pushes it to the 'origin' remote.

EXAMPLE 2

New-SamplerGitHubReleaseTag -ReturnToCurrentBranch

Creates a new release tag and switches back to the previous branch.

PARAMETERS

-DefaultBranchName

Specifies the name of the default branch. Default value is 'main'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: Main
Accept pipeline input: False
Accept wildcard characters: False

-Force

Specifies that the command should run without prompting for confirmation.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-PushTag

Specifies that the tag should also be pushed to the upstream remote after creating it. This will always ask for confirmation before pushing the tag, unless Force is also specified.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-ReleaseTag

Specifies the release tag to create. Must be in the format 'vX.X.X'. If not specified, the latest preview tag will be used.

Type: String
Parameter Sets: (All)
Aliases:

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

-ReturnToCurrentBranch

Specifies that the command should switches back to the previous branch after creating the release tag.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-UpstreamRemoteName

Specifies the name of the upstream remote. Default value is 'origin'.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: Origin
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

-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

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

None

This function does not accept values over the pipeline.

OUTPUTS

None

This function does not return any objects.

NOTES

RELATED LINKS

Clone this wiki locally