From 858355be67185d816096e03e76f28d441c7b333a Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Mon, 1 Oct 2018 10:58:47 +0200 Subject: [PATCH] Fixed publishing of github release --- AtlassianPS.Configuration.build.ps1 | 2 ++ Tools/BuildTools.psm1 | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/AtlassianPS.Configuration.build.ps1 b/AtlassianPS.Configuration.build.ps1 index 5e361a7..216d098 100644 --- a/AtlassianPS.Configuration.build.ps1 +++ b/AtlassianPS.Configuration.build.ps1 @@ -293,6 +293,8 @@ task PublishToGallery { # Synopsis: push a tag with the version to the git repository task TagReplository GetNextVersion, { + Assert-True (-not [String]::IsNullOrEmpty($GithubAccessToken)) "No key for the PSGallery" + $releaseText = "Release version $env:NextBuildVersion" # Push a tag to the repository diff --git a/Tools/BuildTools.psm1 b/Tools/BuildTools.psm1 index ce9cd9e..b4c88c0 100644 --- a/Tools/BuildTools.psm1 +++ b/Tools/BuildTools.psm1 @@ -142,8 +142,9 @@ function Test-ShouldDeploy { function Publish-GithubRelease { param( [Parameter( Mandatory )] - [ValidateNotNullOrEmpty] - $GITHUB_ACCESS_TOKEN, + [ValidateNotNullOrEmpty()] + [String]$GITHUB_ACCESS_TOKEN, + [String]$ProjectOwner = "AtlassianPS", [String]$ReleaseText, [Object]$NextBuildVersion ) @@ -160,7 +161,7 @@ function Publish-GithubRelease { } | ConvertTo-Json $releaseParams = @{ - Uri = "https://api.github.com/repos/{0}/releases" -f $env:BHProjectName + Uri = "https://api.github.com/repos/{0}/{1}/releases" -f $ProjectOwner, $env:BHProjectName Method = 'POST' Headers = @{ Authorization = 'Basic ' + [Convert]::ToBase64String(