< Back

Publish-GithubRelease

Sun Jan 12, 2020 6:48 pm

NAME Publish-GithubRelease



SYNOPSIS

Publish a new release on a Github repository





SYNTAX

Publish-GithubRelease [-AccessToken] <String> [-RepositoryOwner] <String> [[-RepositoryName] <String>] [-TagName]

<String> [[-TargetCommit] <String>] [[-Name] <String>] [[-ReleaseText] <String>] [-Draft] [-PreRelease]

[[-Artifact] <String[]>] [<CommonParameters>]





DESCRIPTION





PARAMETERS

-AccessToken <String>

Personal API Token for authentication



This sha string must be generated by a user that has push access to

the repository.

More information can be found at:

https://blog.github.com/2013-05-16-personal-api-tokens/



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RepositoryOwner <String>

Name of the Github user or organization hosting the repository



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RepositoryName <String>

Name of the Github repository



Default: $env:BHProjectName



Required? false

Position? 3

Default value (Get-ProjectName)

Accept pipeline input? false

Accept wildcard characters? false



-TagName <String>

Name of the tag



Required? true

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TargetCommit <String>

Specifies the commitish value that determines where the Git tag is

created from. Can be any branch or commit SHA.



Unused if the Git tag already exists.

Default: the repository's default branch (usually master).



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Name <String>

Name of the release



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ReleaseText <String>

Text describing the contents of the tag.



Required? false

Position? 7

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Draft [<SwitchParameter>]

Create a draft (unpublished) release



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-PreRelease [<SwitchParameter>]

Identify the release as a prerelease



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Artifact <String[]>

Path to the artifact to upload to the release



Required? false

Position? 8

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Publish-GithubRelease -AccessToken $mySecretToken -TagName "v1.0"



Create a new release for the tag "v1.0".

The name of the repository is assumed to be the same as the BHProjectName.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Publish-GithubRelease -AccessToken $mySecretToken -TagName "v0.1" -Name "Beta Version 0.1" -PreRelease



Create a new pre-release for the tag "v0.1".









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Publish-GithubRelease -AccessToken $mySecretToken -TagName "v1.0" -Draft



Create a draft for a release on tag "v1.0".









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>$release = @{



AccessToken = "00000000000000000000000"

TagName = "v1.0"

Name = "Version 1.0"

ReleaseText = "First version of my cool thing"

Draft = $true

PreRelease = $false

RepositoryName = "MyGithubRepository"

}

Publish-GithubRelease @release



Create a new draft release by using splatting (more info at "about_splatting").











RELATED LINKS

https://developer.github.com/v3/repos/releases/

https://blog.github.com/2013-05-16-personal-api-tokens/