From ef8b53a8d2f88d785d27bd0c82063ee557bce22a Mon Sep 17 00:00:00 2001 From: Joel Timothy Oh Date: Mon, 20 May 2024 19:28:09 +0000 Subject: [PATCH] Fix (release): Fix default variable values for when `$env:RELEASE_DRAFT` and `$env:RELEASE_PRERELEASE` are null or undefined --- src/scripts/ci/Invoke-Release.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/ci/Invoke-Release.ps1 b/src/scripts/ci/Invoke-Release.ps1 index 8718096..8242de0 100644 --- a/src/scripts/ci/Invoke-Release.ps1 +++ b/src/scripts/ci/Invoke-Release.ps1 @@ -47,8 +47,8 @@ try { "Default release notes not found at the path '$private:defaultReleaseNotesPath'. No release notes will be included with the release." | Write-Verbose } } - if ($env:RELEASE_DRAFT) { $private:createReleaseArgs['Draft'] = [System.Convert]::ToBoolean($env:RELEASE_DRAFT) } else { $false } - if ($env:RELEASE_PRERELEASE) { $private:createReleaseArgs['Prerelease'] = [System.Convert]::ToBoolean($env:RELEASE_PRERELEASE) } else { $false } + $private:createReleaseArgs['Draft'] = if ($env:RELEASE_DRAFT) { [System.Convert]::ToBoolean($env:RELEASE_DRAFT) } else { $false } + $private:createReleaseArgs['Prerelease'] = if ($env:RELEASE_PRERELEASE) { [System.Convert]::ToBoolean($env:RELEASE_PRERELEASE) } else { $false } $response = Create-GitHubRelease @private:createReleaseArgs $responseContent = $response.Content | ConvertFrom-Json