Skip to content

Commit 1f288c3

Browse files
authored
Fix issue #22 (#23)
1 parent 123b095 commit 1f288c3

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

.build/tasks/New-Release.GitHub.build.ps1

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ task Publish_release_to_GitHub -if ($GitHubToken -and (Get-Module -Name PowerShe
9393

9494
if (!$SkipPublish)
9595
{
96-
Write-Build DarkGray "Publishing GitHub release:"
97-
Write-Build DarkGray ($releaseParams | Out-String)
96+
Write-Build DarkGray "About to publish a GitHub release for release tag '$ReleaseTag'."
9897

9998
$getGHReleaseParams = @{
10099
Tag = $ReleaseTag
@@ -105,9 +104,9 @@ task Publish_release_to_GitHub -if ($GitHubToken -and (Get-Module -Name PowerShe
105104
}
106105

107106
$displayGHReleaseParams = $getGHReleaseParams.Clone()
108-
$displayGHReleaseParams['AccessToken'] = 'Redacted'
107+
$displayGHReleaseParams['AccessToken'] = '<Redacted>'
109108

110-
Write-Build DarkGray "Checking if the Release exists: `r`n Get-GithubRelease $($displayGHReleaseParams | Out-String)"
109+
Write-Build DarkGray "Checking if the Release exists. Calling Get-GithubRelease with the parameters:`r`n$($displayGHReleaseParams | Out-String)"
111110

112111
try
113112
{
@@ -129,10 +128,10 @@ task Publish_release_to_GitHub -if ($GitHubToken -and (Get-Module -Name PowerShe
129128
Prerelease = [bool]($PreReleaseTag)
130129
Body = $ReleaseNotes
131130
AccessToken = $GitHubToken
132-
Verbose = $true
131+
Verbose = $VerbosePreference
133132
}
134133

135-
Write-Build DarkGray "Creating new GitHub release '$ReleaseTag ' at '$remoteURL'."
134+
Write-Build DarkGray "Creating new GitHub release '$ReleaseTag' at '$remoteURL'."
136135
$APIResponse = New-GitHubRelease @releaseParams
137136
Write-Build Green "Release Created. Adding Assets..."
138137
if ((-not [string]::IsNullOrEmpty($PackageToRelease)) -and (Test-Path -Path $PackageToRelease))

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828
- Updated the Readme with the icon.
2929
- Adding delay after creating release to make sure the tag is available at next git pull.
3030
- Updating when to skip the Create Changelog PR task (adding -ListAvailable).
31+
- Task `Publish_release_to_GitHub`
32+
- Removed unnecessary code line ([issue #22](https://github.com/gaelcolas/Sampler.GitHubTasks/issues/22)).
33+
- Now the command `New-GitHubRelease` only outputs verbose information
34+
if `$VerbosePreference` says so.
3135

3236
### Fixed
3337

0 commit comments

Comments
 (0)