From a2500df030afddcd4a4b0ea7f6185e7f32f93ea3 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 22 Jan 2026 19:42:41 +0100 Subject: [PATCH 01/15] Remove deprecated release.yml configuration --- .github/release.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index 35c6ae8..0000000 --- a/.github/release.yml +++ /dev/null @@ -1,18 +0,0 @@ -# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes - -changelog: - exclude: - labels: - - NoRelease - categories: - - title: 🌟 Breaking Changes - labels: - - Major - - Breaking - - title: 🚀 New Features - labels: - - Minor - - Feature - - title: Other Changes - labels: - - '*' From f5a4cd44f584c54b8694f9e9c3f44f7051f2a803 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 25 Jan 2026 18:31:33 +0100 Subject: [PATCH 02/15] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Fix=20typo=20in?= =?UTF-8?q?=20IncrementalPrerelease=20description=20in=20action.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 9e70917..2b03521 100644 --- a/action.yml +++ b/action.yml @@ -22,7 +22,7 @@ inputs: required: false default: 'true' IncrementalPrerelease: - description: Control wether to automatically increment the prerelease number. If disabled, the action will ensure only one prerelease exists for a given branch. + description: Control whether to automatically increment the prerelease number. If disabled, the action will ensure only one prerelease exists for a given branch. required: false default: 'true' DatePrereleaseFormat: From 151cf814f696520249612b6a9dd2b21fa49dd9d7 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 25 Jan 2026 21:32:28 +0100 Subject: [PATCH 03/15] feat: Implement automated release process with GitHub Actions - Remove old publish script and replace it with a new structured approach using init.ps1, publish.ps1, and cleanup.ps1. - Add GitHub Actions workflow for automated releases triggered by pull request events. - Introduce new parameters for managing versioning and release types, including support for prereleases and cleanup of old prereleases. - Enhance logging and error handling throughout the scripts for better traceability. --- .github/workflows/{Auto-Release.yml => Release.yml} | 11 +++++++---- action.yml | 6 +++--- {scripts => src}/cleanup.ps1 | 0 {scripts => src}/init.ps1 | 0 {scripts => src}/publish.ps1 | 0 5 files changed, 10 insertions(+), 7 deletions(-) rename .github/workflows/{Auto-Release.yml => Release.yml} (73%) rename {scripts => src}/cleanup.ps1 (100%) rename {scripts => src}/init.ps1 (100%) rename {scripts => src}/publish.ps1 (100%) diff --git a/.github/workflows/Auto-Release.yml b/.github/workflows/Release.yml similarity index 73% rename from .github/workflows/Auto-Release.yml rename to .github/workflows/Release.yml index 643724c..3cb8396 100644 --- a/.github/workflows/Auto-Release.yml +++ b/.github/workflows/Release.yml @@ -1,6 +1,6 @@ -name: Auto-Release +name: Release -run-name: "Auto-Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}" +run-name: "Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}" on: pull_request: @@ -12,6 +12,9 @@ on: - reopened - synchronize - labeled + paths: + - 'action.yml' + - 'src/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -22,7 +25,7 @@ permissions: pull-requests: write jobs: - Auto-Release: + Release: runs-on: ubuntu-latest steps: - name: Checkout Code @@ -30,7 +33,7 @@ jobs: with: persist-credentials: false - - name: Auto-Release + - name: Release uses: PSModule/Auto-Release@eabd533035e2cb9822160f26f2eda584bd012356 # v1.9.5 with: IncrementalPrerelease: false diff --git a/action.yml b/action.yml index 2b03521..65b04cc 100644 --- a/action.yml +++ b/action.yml @@ -102,7 +102,7 @@ runs: PSMODULE_PUBLISH_PSMODULE_INPUT_PatchLabels: ${{ inputs.PatchLabels }} PSMODULE_PUBLISH_PSMODULE_INPUT_VersionPrefix: ${{ inputs.VersionPrefix }} PSMODULE_PUBLISH_PSMODULE_INPUT_WhatIf: ${{ inputs.WhatIf }} - run: ${{ github.action_path }}/scripts/init.ps1 + run: ${{ github.action_path }}/src/init.ps1 - name: Download module artifact if: env.PUBLISH_CONTEXT_ShouldPublish == 'true' || inputs.WhatIf == 'true' @@ -123,7 +123,7 @@ runs: PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRBodyAsReleaseNotes: ${{ inputs.UsePRBodyAsReleaseNotes }} PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRTitleAsReleaseName: ${{ inputs.UsePRTitleAsReleaseName }} PSMODULE_PUBLISH_PSMODULE_INPUT_UsePRTitleAsNotesHeading: ${{ inputs.UsePRTitleAsNotesHeading }} - run: ${{ github.action_path }}/scripts/publish.ps1 + run: ${{ github.action_path }}/src/publish.ps1 - name: Cleanup Prereleases if: env.PUBLISH_CONTEXT_ShouldCleanup == 'true' || inputs.WhatIf == 'true' @@ -131,4 +131,4 @@ runs: working-directory: ${{ inputs.WorkingDirectory }} env: PSMODULE_PUBLISH_PSMODULE_INPUT_WhatIf: ${{ inputs.WhatIf }} - run: ${{ github.action_path }}/scripts/cleanup.ps1 + run: ${{ github.action_path }}/src/cleanup.ps1 diff --git a/scripts/cleanup.ps1 b/src/cleanup.ps1 similarity index 100% rename from scripts/cleanup.ps1 rename to src/cleanup.ps1 diff --git a/scripts/init.ps1 b/src/init.ps1 similarity index 100% rename from scripts/init.ps1 rename to src/init.ps1 diff --git a/scripts/publish.ps1 b/src/publish.ps1 similarity index 100% rename from scripts/publish.ps1 rename to src/publish.ps1 From 45b52e81e42ff757dfd8541fd6ec45eb807a0aa6 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 25 Jan 2026 22:01:38 +0100 Subject: [PATCH 04/15] Disable JSCPD linter and remove configuration file --- .github/linters/.jscpd.json | 10 ---------- .github/workflows/Linter.yml | 1 + 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 .github/linters/.jscpd.json diff --git a/.github/linters/.jscpd.json b/.github/linters/.jscpd.json deleted file mode 100644 index 23970e8..0000000 --- a/.github/linters/.jscpd.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "threshold": 0, - "reporters": [ - "consoleFull" - ], - "ignore": [ - "**/tests/**" - ], - "absolute": true -} diff --git a/.github/workflows/Linter.yml b/.github/workflows/Linter.yml index 377763a..3a07190 100644 --- a/.github/workflows/Linter.yml +++ b/.github/workflows/Linter.yml @@ -29,6 +29,7 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} VALIDATE_BIOME_FORMAT: false + VALIDATE_JSCPD: false VALIDATE_JSON_PRETTIER: false VALIDATE_MARKDOWN_PRETTIER: false VALIDATE_YAML_PRETTIER: false From 1c03ca33625b5b443a9df5b0d11ec0bc76559e48 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 25 Jan 2026 22:32:24 +0100 Subject: [PATCH 05/15] Rename Auto-Release to Release-GHRepository --- .github/workflows/Release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 3cb8396..38fbd49 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -34,6 +34,6 @@ jobs: persist-credentials: false - name: Release - uses: PSModule/Auto-Release@eabd533035e2cb9822160f26f2eda584bd012356 # v1.9.5 + uses: PSModule/Release-GHRepository@88c70461c8f16cc09682005bcf3b7fca4dd8dc1a # v2 with: IncrementalPrerelease: false From 3b4309dc944c2bd1654a0f5f07b881c95a743657 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 25 Jan 2026 22:44:48 +0100 Subject: [PATCH 06/15] Fix version comment to use patch level --- .github/workflows/Release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 38fbd49..15ea61e 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -34,6 +34,6 @@ jobs: persist-credentials: false - name: Release - uses: PSModule/Release-GHRepository@88c70461c8f16cc09682005bcf3b7fca4dd8dc1a # v2 + uses: PSModule/Release-GHRepository@88c70461c8f16cc09682005bcf3b7fca4dd8dc1a # v2.0.1 with: IncrementalPrerelease: false From 817553a72c5841c838c9673b9c9af716dfb482df Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 27 Jan 2026 10:16:56 +0100 Subject: [PATCH 07/15] refactor: Update output messages for PowerShell Gallery publishing and GitHub release --- src/publish.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/publish.ps1 b/src/publish.ps1 index 6f074ce..dc539e2 100644 --- a/src/publish.ps1 +++ b/src/publish.ps1 @@ -89,7 +89,7 @@ LogGroup 'Publish-ToPSGallery' { $publishPSVersion = "$($newVersion.Major).$($newVersion.Minor).$($newVersion.Patch)" } $psGalleryReleaseLink = "https://www.powershellgallery.com/packages/$name/$publishPSVersion" - Write-Output "Publish module to PowerShell Gallery using API key from environment." + Write-Output 'Publish module to PowerShell Gallery using API key from environment.' if ($whatIf) { Write-Output "Publish-PSResource -Path $modulePath -Repository PSGallery -ApiKey ***" } else { @@ -106,7 +106,7 @@ LogGroup 'Publish-ToPSGallery' { "'Module [$name - $publishPSVersion]($psGalleryReleaseLink) published to the PowerShell Gallery.'" ) } else { - Write-Host "::notice::Module [$name - $publishPSVersion] published to the PowerShell Gallery." + Write-Host "::notice title=New publication: PowerShell Gallery - $name $publishPSVersion::$psGalleryReleaseLink" gh pr comment $prNumber -b "Module [$name - $publishPSVersion]($psGalleryReleaseLink) published to the PowerShell Gallery." if ($LASTEXITCODE -ne 0) { Write-Error 'Failed to comment on the pull request.' @@ -189,7 +189,7 @@ LogGroup 'New-GitHubRelease' { exit $LASTEXITCODE } } - Write-Host "::notice::Release created: [$newVersion]" + Write-Host "::notice title=New release: GitHub - $name $newVersion::$releaseURL" } Write-Output "Publishing complete. Version: [$($newVersion.ToString())]" From cb82392569c00e4562b192b55fba565c9fbccaeb Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 27 Jan 2026 10:51:23 +0100 Subject: [PATCH 08/15] Align PR comment text with notice output format --- src/publish.ps1 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/publish.ps1 b/src/publish.ps1 index dc539e2..caa59a4 100644 --- a/src/publish.ps1 +++ b/src/publish.ps1 @@ -83,6 +83,7 @@ LogGroup 'Install module dependencies' { } LogGroup 'Publish-ToPSGallery' { + $releaseType = if ($createPrerelease) { 'New prerelease' } else { 'New release' } if ($createPrerelease) { $publishPSVersion = "$($newVersion.Major).$($newVersion.Minor).$($newVersion.Patch)-$($newVersion.Prerelease)" } else { @@ -103,11 +104,11 @@ LogGroup 'Publish-ToPSGallery' { if ($whatIf) { Write-Output ( "gh pr comment $prNumber -b " + - "'Module [$name - $publishPSVersion]($psGalleryReleaseLink) published to the PowerShell Gallery.'" + "'✅ $releaseType`: PowerShell Gallery - [$name $publishPSVersion]($psGalleryReleaseLink)'" ) } else { - Write-Host "::notice title=New publication: PowerShell Gallery - $name $publishPSVersion::$psGalleryReleaseLink" - gh pr comment $prNumber -b "Module [$name - $publishPSVersion]($psGalleryReleaseLink) published to the PowerShell Gallery." + Write-Host "::notice title=$releaseType`: PowerShell Gallery - $name $publishPSVersion::$psGalleryReleaseLink" + gh pr comment $prNumber -b "✅ $releaseType`: PowerShell Gallery - [$name $publishPSVersion]($psGalleryReleaseLink)" if ($LASTEXITCODE -ne 0) { Write-Error 'Failed to comment on the pull request.' exit $LASTEXITCODE @@ -177,19 +178,20 @@ LogGroup 'New-GitHubRelease' { Remove-Item -Path $notesFilePath -Force } + $releaseType = if ($createPrerelease) { 'New prerelease' } else { 'New release' } if ($whatIf) { Write-Output ( "gh pr comment $prNumber -b " + - "'GitHub release for $name $newVersion has been created.'" + "'✅ $releaseType`: GitHub - $name $newVersion'" ) } else { - gh pr comment $prNumber -b "GitHub release for $name [$newVersion]($releaseURL) has been created." + gh pr comment $prNumber -b "✅ $releaseType`: GitHub - [$name $newVersion]($releaseURL)" if ($LASTEXITCODE -ne 0) { Write-Error 'Failed to comment on the pull request.' exit $LASTEXITCODE } } - Write-Host "::notice title=New release: GitHub - $name $newVersion::$releaseURL" + Write-Host "::notice title=$releaseType`: GitHub - $name $newVersion::$releaseURL" } Write-Output "Publishing complete. Version: [$($newVersion.ToString())]" From 267df3f928efe312344ab6850d197ea60021900b Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 27 Jan 2026 11:25:21 +0100 Subject: [PATCH 09/15] style: Update notice output format to include checkmark for clarity --- src/publish.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/publish.ps1 b/src/publish.ps1 index caa59a4..2137e67 100644 --- a/src/publish.ps1 +++ b/src/publish.ps1 @@ -107,7 +107,7 @@ LogGroup 'Publish-ToPSGallery' { "'✅ $releaseType`: PowerShell Gallery - [$name $publishPSVersion]($psGalleryReleaseLink)'" ) } else { - Write-Host "::notice title=$releaseType`: PowerShell Gallery - $name $publishPSVersion::$psGalleryReleaseLink" + Write-Host "::notice title=✅ $releaseType`: PowerShell Gallery - $name $publishPSVersion::$psGalleryReleaseLink" gh pr comment $prNumber -b "✅ $releaseType`: PowerShell Gallery - [$name $publishPSVersion]($psGalleryReleaseLink)" if ($LASTEXITCODE -ne 0) { Write-Error 'Failed to comment on the pull request.' @@ -191,7 +191,7 @@ LogGroup 'New-GitHubRelease' { exit $LASTEXITCODE } } - Write-Host "::notice title=$releaseType`: GitHub - $name $newVersion::$releaseURL" + Write-Host "::notice title=✅ $releaseType`: GitHub - $name $newVersion::$releaseURL" } Write-Output "Publishing complete. Version: [$($newVersion.ToString())]" From 7e04e5e9cd3e111108d906b428e4e2edcc24eecf Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 27 Jan 2026 17:25:27 +0100 Subject: [PATCH 10/15] refactor: Replace Write-Output with Write-Host for consistent output handling --- .../linters/.powershell-psscriptanalyzer.psd1 | 1 + src/cleanup.ps1 | 16 +-- src/init.ps1 | 118 +++++++++--------- src/publish.ps1 | 48 +++---- 4 files changed, 92 insertions(+), 91 deletions(-) diff --git a/.github/linters/.powershell-psscriptanalyzer.psd1 b/.github/linters/.powershell-psscriptanalyzer.psd1 index 09cc3d0..f79ca2a 100644 --- a/.github/linters/.powershell-psscriptanalyzer.psd1 +++ b/.github/linters/.powershell-psscriptanalyzer.psd1 @@ -50,6 +50,7 @@ } } ExcludeRules = @( + 'PSAvoidUsingWriteHost', # This action runs on GitHub Actions which supports Write-Host. 'PSMissingModuleManifestField', # This rule is not applicable until the module is built. 'PSUseToExportFieldsInManifest' ) diff --git a/src/cleanup.ps1 b/src/cleanup.ps1 index 2363894..7a11de0 100644 --- a/src/cleanup.ps1 +++ b/src/cleanup.ps1 @@ -14,32 +14,32 @@ if ([string]::IsNullOrWhiteSpace($prereleaseName)) { LogGroup "Cleanup prereleases for [$prereleaseName]" { if ([string]::IsNullOrWhiteSpace($prereleaseTagsToCleanup)) { - Write-Output "No prereleases found to cleanup for [$prereleaseName]." + Write-Host "No prereleases found to cleanup for [$prereleaseName]." return } $tagsToDelete = $prereleaseTagsToCleanup -split ',' | Where-Object { -not [string]::IsNullOrWhiteSpace($_) } if ($tagsToDelete.Count -eq 0) { - Write-Output "No prereleases found to cleanup for [$prereleaseName]." + Write-Host "No prereleases found to cleanup for [$prereleaseName]." return } - Write-Output "Found $($tagsToDelete.Count) prereleases to cleanup:" - $tagsToDelete | ForEach-Object { Write-Output " - $_" } - Write-Output '' + Write-Host "Found $($tagsToDelete.Count) prereleases to cleanup:" + $tagsToDelete | ForEach-Object { Write-Host " - $_" } + Write-Host '' foreach ($tag in $tagsToDelete) { - Write-Output "Deleting prerelease: [$tag]" + Write-Host "Deleting prerelease: [$tag]" if ($whatIf) { - Write-Output "WhatIf: gh release delete $tag --cleanup-tag --yes" + Write-Host "WhatIf: gh release delete $tag --cleanup-tag --yes" } else { gh release delete $tag --cleanup-tag --yes if ($LASTEXITCODE -ne 0) { Write-Error "Failed to delete release [$tag]." exit $LASTEXITCODE } - Write-Output "Successfully deleted release [$tag]." + Write-Host "Successfully deleted release [$tag]." } } diff --git a/src/init.ps1 b/src/init.ps1 index d562d48..8320cea 100644 --- a/src/init.ps1 +++ b/src/init.ps1 @@ -29,7 +29,7 @@ LogGroup 'Load inputs' { } else { $env:PSMODULE_PUBLISH_PSMODULE_INPUT_Name } - Write-Output "Module name: [$name]" + Write-Host "Module name: [$name]" } LogGroup 'Set configuration' { @@ -83,10 +83,10 @@ LogGroup 'Event information - Details' { } $prHeadRef = $pull_request.head.ref - Write-Output '-------------------------------------------------' - Write-Output "PR Head Ref: [$prHeadRef]" - Write-Output "ReleaseType: [$releaseType]" - Write-Output '-------------------------------------------------' + Write-Host '-------------------------------------------------' + Write-Host "PR Head Ref: [$prHeadRef]" + Write-Host "ReleaseType: [$releaseType]" + Write-Host '-------------------------------------------------' } LogGroup 'Pull request - details' { @@ -122,7 +122,7 @@ LogGroup 'Determine release configuration' { # Check for ignore labels that override the release type $ignoreRelease = ($labels | Where-Object { $ignoreLabels -contains $_ }).Count -gt 0 if ($ignoreRelease -and $shouldPublish) { - Write-Output 'Ignoring release creation due to ignore label.' + Write-Host 'Ignoring release creation due to ignore label.' $shouldPublish = $false } @@ -141,23 +141,23 @@ LogGroup 'Determine release configuration' { $hasVersionBump = $majorRelease -or $minorRelease -or $patchRelease if (-not $hasVersionBump) { - Write-Output 'No version bump label found and AutoPatching is disabled. Skipping publish.' + Write-Host 'No version bump label found and AutoPatching is disabled. Skipping publish.' $shouldPublish = $false } } elseif (-not $ignoreRelease) { - Write-Output "ReleaseType is [$releaseType]. No publishing required." + Write-Host "ReleaseType is [$releaseType]. No publishing required." } - Write-Output '-------------------------------------------------' - Write-Output "ReleaseType: [$releaseType]" - Write-Output "AutoCleanup: [$autoCleanup]" - Write-Output "Should publish: [$shouldPublish]" - Write-Output "Create a release: [$createRelease]" - Write-Output "Create a prerelease: [$createPrerelease]" - Write-Output "Create a major release: [$majorRelease]" - Write-Output "Create a minor release: [$minorRelease]" - Write-Output "Create a patch release: [$patchRelease]" - Write-Output '-------------------------------------------------' + Write-Host '-------------------------------------------------' + Write-Host "ReleaseType: [$releaseType]" + Write-Host "AutoCleanup: [$autoCleanup]" + Write-Host "Should publish: [$shouldPublish]" + Write-Host "Create a release: [$createRelease]" + Write-Host "Create a prerelease: [$createPrerelease]" + Write-Host "Create a major release: [$majorRelease]" + Write-Host "Create a minor release: [$minorRelease]" + Write-Host "Create a patch release: [$patchRelease]" + Write-Host '-------------------------------------------------' } #endregion Calculate release type @@ -193,10 +193,10 @@ if ($shouldPublish) { Write-Warning 'Could not find the latest release version. Using ''0.0.0'' as the version.' $ghReleaseVersion = New-PSSemVer -Version '0.0.0' } - Write-Output '-------------------------------------------------' - Write-Output 'GitHub version:' - Write-Output $ghReleaseVersion.ToString() - Write-Output '-------------------------------------------------' + Write-Host '-------------------------------------------------' + Write-Host 'GitHub version:' + Write-Host $ghReleaseVersion.ToString() + Write-Host '-------------------------------------------------' } LogGroup 'Get latest version - PSGallery' { @@ -204,9 +204,9 @@ if ($shouldPublish) { $delay = 10 for ($i = 1; $i -le $count; $i++) { try { - Write-Output "Finding module [$name] in the PowerShell Gallery." + Write-Host "Finding module [$name] in the PowerShell Gallery." $latest = Find-PSResource -Name $name -Repository PSGallery -Verbose:$false - Write-Output "$($latest | Format-Table | Out-String)" + Write-Host "$($latest | Format-Table | Out-String)" break } catch { if ($i -eq $count) { @@ -222,21 +222,21 @@ if ($shouldPublish) { Write-Warning 'Could not find module online. Using ''0.0.0'' as the version.' $psGalleryVersion = New-PSSemVer -Version '0.0.0' } - Write-Output '-------------------------------------------------' - Write-Output 'PSGallery version:' - Write-Output $psGalleryVersion.ToString() - Write-Output '-------------------------------------------------' + Write-Host '-------------------------------------------------' + Write-Host 'PSGallery version:' + Write-Host $psGalleryVersion.ToString() + Write-Host '-------------------------------------------------' } LogGroup 'Get latest version' { - Write-Output "GitHub: [$($ghReleaseVersion.ToString())]" - Write-Output "PSGallery: [$($psGalleryVersion.ToString())]" + Write-Host "GitHub: [$($ghReleaseVersion.ToString())]" + Write-Host "PSGallery: [$($psGalleryVersion.ToString())]" $latestVersion = New-PSSemVer -Version ($psGalleryVersion, $ghReleaseVersion | Sort-Object -Descending | Select-Object -First 1) - Write-Output '-------------------------------------------------' - Write-Output 'Latest version:' - Write-Output ($latestVersion | Format-Table | Out-String) - Write-Output $latestVersion.ToString() - Write-Output '-------------------------------------------------' + Write-Host '-------------------------------------------------' + Write-Host 'Latest version:' + Write-Host ($latestVersion | Format-Table | Out-String) + Write-Host $latestVersion.ToString() + Write-Host '-------------------------------------------------' } LogGroup 'Calculate new version' { @@ -244,32 +244,32 @@ if ($shouldPublish) { $newVersion = New-PSSemVer -Version $latestVersion $newVersion.Prefix = $versionPrefix if ($majorRelease) { - Write-Output 'Incrementing major version.' + Write-Host 'Incrementing major version.' $newVersion.BumpMajor() } elseif ($minorRelease) { - Write-Output 'Incrementing minor version.' + Write-Host 'Incrementing minor version.' $newVersion.BumpMinor() } elseif ($patchRelease) { - Write-Output 'Incrementing patch version.' + Write-Host 'Incrementing patch version.' $newVersion.BumpPatch() } else { - Write-Output 'No version bump required.' + Write-Host 'No version bump required.' } - Write-Output "Partial new version: [$newVersion]" + Write-Host "Partial new version: [$newVersion]" if ($createPrerelease -and $hasVersionBump) { - Write-Output "Adding a prerelease tag to the version using the branch name [$prereleaseName]." - Write-Output ($releases | Where-Object { $_.tagName -like "*$prereleaseName*" } | + Write-Host "Adding a prerelease tag to the version using the branch name [$prereleaseName]." + Write-Host ($releases | Where-Object { $_.tagName -like "*$prereleaseName*" } | Select-Object -Property name, isPrerelease, isLatest, publishedAt | Format-Table -AutoSize | Out-String) $newVersion.Prerelease = $prereleaseName - Write-Output "Partial new version: [$newVersion]" + Write-Host "Partial new version: [$newVersion]" if (-not [string]::IsNullOrEmpty($datePrereleaseFormat)) { - Write-Output "Using date-based prerelease: [$datePrereleaseFormat]." + Write-Host "Using date-based prerelease: [$datePrereleaseFormat]." $newVersion.Prerelease += "$(Get-Date -Format $datePrereleaseFormat)" - Write-Output "Partial new version: [$newVersion]" + Write-Host "Partial new version: [$newVersion]" } if ($incrementalPrerelease) { @@ -285,15 +285,15 @@ if ($shouldPublish) { Verbose = $false ErrorAction = 'SilentlyContinue' } - Write-Output 'Finding the latest prerelease version in the PowerShell Gallery.' - Write-Output ($params | Format-Table | Out-String) + Write-Host 'Finding the latest prerelease version in the PowerShell Gallery.' + Write-Host ($params | Format-Table | Out-String) $psGalleryPrereleases = Find-PSResource @params $psGalleryPrereleases = $psGalleryPrereleases | Where-Object { $_.Version -like "$newVersionString" } $psGalleryPrereleases = $psGalleryPrereleases | Where-Object { $_.Prerelease -like "$prereleaseName*" } $latestPSGalleryPrerelease = $psGalleryPrereleases.Prerelease | ForEach-Object { [int]($_ -replace $prereleaseName) } | Sort-Object | Select-Object -Last 1 - Write-Output "PSGallery prerelease: [$latestPSGalleryPrerelease]" + Write-Host "PSGallery prerelease: [$latestPSGalleryPrerelease]" # GitHub $ghPrereleases = $releases | Where-Object { $_.tagName -like "*$newVersionString*" } @@ -304,7 +304,7 @@ if ($shouldPublish) { $number = ($number -split $prereleaseName, 2)[-1] [int]$number } | Sort-Object | Select-Object -Last 1 - Write-Output "GitHub prerelease: [$latestGHPrereleases]" + Write-Host "GitHub prerelease: [$latestGHPrereleases]" # Handle null values explicitly to ensure Math.Max works correctly if ($null -eq $latestPSGalleryPrerelease) { $latestPSGalleryPrerelease = 0 } @@ -316,11 +316,11 @@ if ($shouldPublish) { $newVersion.Prerelease += $latestPrereleaseNumber } } - Write-Output '-------------------------------------------------' - Write-Output 'New version:' - Write-Output ($newVersion | Format-Table | Out-String) - Write-Output $newVersion.ToString() - Write-Output '-------------------------------------------------' + Write-Host '-------------------------------------------------' + Write-Host 'New version:' + Write-Host ($newVersion | Format-Table | Out-String) + Write-Host $newVersion.ToString() + Write-Host '-------------------------------------------------' } #endregion Calculate new version } @@ -332,7 +332,7 @@ if ($autoCleanup) { $prereleasesToCleanup = $releases | Where-Object { $_.tagName -like "*$prereleaseName*" } $prereleasesToCleanup | Select-Object -Property name, publishedAt, isPrerelease, isLatest | Format-Table | Out-String $prereleaseTagsToCleanup = ($prereleasesToCleanup | ForEach-Object { $_.tagName }) -join ',' - Write-Output "Prereleases to cleanup: [$prereleaseTagsToCleanup]" + Write-Host "Prereleases to cleanup: [$prereleaseTagsToCleanup]" } } #endregion Find prereleases to cleanup @@ -354,8 +354,8 @@ LogGroup 'Store context in environment variables' { Add-Content -Path $env:GITHUB_ENV -Value "PUBLISH_CONTEXT_PRNumber=$($pull_request.number.ToString())" Add-Content -Path $env:GITHUB_ENV -Value "PUBLISH_CONTEXT_PRHeadRef=$prHeadRef" - Write-Output '-------------------------------------------------' - Write-Output 'Stored environment variables:' + Write-Host '-------------------------------------------------' + Write-Host 'Stored environment variables:' [PSCustomObject]@{ ShouldPublish = $shouldPublish ShouldCleanup = $autoCleanup @@ -370,7 +370,7 @@ LogGroup 'Store context in environment variables' { PRNumber = $pull_request.number PRHeadRef = $prHeadRef } | Format-List | Out-String - Write-Output '-------------------------------------------------' + Write-Host '-------------------------------------------------' } -Write-Output "Context initialization complete. ShouldPublish=[$shouldPublish], ShouldCleanup=[$autoCleanup]" +Write-Host "Context initialization complete. ShouldPublish=[$shouldPublish], ShouldCleanup=[$autoCleanup]" diff --git a/src/publish.ps1 b/src/publish.ps1 index 2137e67..f65748c 100644 --- a/src/publish.ps1 +++ b/src/publish.ps1 @@ -14,8 +14,8 @@ LogGroup 'Load inputs' { $modulePath = Resolve-Path -Path "$env:PSMODULE_PUBLISH_PSMODULE_INPUT_ModulePath/$name" | Select-Object -ExpandProperty Path $apiKey = $env:PSMODULE_PUBLISH_PSMODULE_INPUT_APIKey - Write-Output "Module name: [$name]" - Write-Output "Module path: [$modulePath]" + Write-Host "Module name: [$name]" + Write-Host "Module path: [$modulePath]" } LogGroup 'Load publish context from environment' { @@ -36,15 +36,15 @@ LogGroup 'Load publish context from environment' { $newVersion = New-PSSemVer -Version $newVersionString - Write-Output '-------------------------------------------------' - Write-Output 'Publish context:' - Write-Output " CreateRelease: [$createRelease]" - Write-Output " CreatePrerelease: [$createPrerelease]" - Write-Output " NewVersion: [$($newVersion.ToString())]" - Write-Output " PRNumber: [$prNumber]" - Write-Output " PRHeadRef: [$prHeadRef]" - Write-Output " WhatIf: [$whatIf]" - Write-Output '-------------------------------------------------' + Write-Host '-------------------------------------------------' + Write-Host 'Publish context:' + Write-Host " CreateRelease: [$createRelease]" + Write-Host " CreatePrerelease: [$createPrerelease]" + Write-Host " NewVersion: [$($newVersion.ToString())]" + Write-Host " PRNumber: [$prNumber]" + Write-Host " PRHeadRef: [$prHeadRef]" + Write-Host " WhatIf: [$whatIf]" + Write-Host '-------------------------------------------------' } LogGroup 'Load PR information' { @@ -59,7 +59,7 @@ LogGroup 'Load PR information' { LogGroup 'Validate manifest and set module path' { Add-PSModulePath -Path (Split-Path -Path $modulePath -Parent) $manifestFilePath = Join-Path $modulePath "$name.psd1" - Write-Output "Module manifest file path: [$manifestFilePath]" + Write-Host "Module manifest file path: [$manifestFilePath]" if (-not (Test-Path -Path $manifestFilePath)) { Write-Error "Module manifest file not found at [$manifestFilePath]" exit 1 @@ -67,11 +67,11 @@ LogGroup 'Validate manifest and set module path' { } LogGroup 'Update module manifest' { - Write-Output 'Bump module version -> module metadata: Update-ModuleMetadata' + Write-Host 'Bump module version -> module metadata: Update-ModuleMetadata' $manifestNewVersion = "$($newVersion.Major).$($newVersion.Minor).$($newVersion.Patch)" Set-ModuleManifest -Path $manifestFilePath -ModuleVersion $manifestNewVersion -Verbose:$false if ($createPrerelease) { - Write-Output "Prerelease is: [$($newVersion.Prerelease)]" + Write-Host "Prerelease is: [$($newVersion.Prerelease)]" Set-ModuleManifest -Path $manifestFilePath -Prerelease $($newVersion.Prerelease) -Verbose:$false } @@ -90,9 +90,9 @@ LogGroup 'Publish-ToPSGallery' { $publishPSVersion = "$($newVersion.Major).$($newVersion.Minor).$($newVersion.Patch)" } $psGalleryReleaseLink = "https://www.powershellgallery.com/packages/$name/$publishPSVersion" - Write-Output 'Publish module to PowerShell Gallery using API key from environment.' + Write-Host 'Publish module to PowerShell Gallery using API key from environment.' if ($whatIf) { - Write-Output "Publish-PSResource -Path $modulePath -Repository PSGallery -ApiKey ***" + Write-Host "Publish-PSResource -Path $modulePath -Repository PSGallery -ApiKey ***" } else { try { Publish-PSResource -Path $modulePath -Repository PSGallery -ApiKey $apiKey @@ -102,7 +102,7 @@ LogGroup 'Publish-ToPSGallery' { } } if ($whatIf) { - Write-Output ( + Write-Host ( "gh pr comment $prNumber -b " + "'✅ $releaseType`: PowerShell Gallery - [$name $publishPSVersion]($psGalleryReleaseLink)'" ) @@ -117,7 +117,7 @@ LogGroup 'Publish-ToPSGallery' { } LogGroup 'New-GitHubRelease' { - Write-Output 'Create new GitHub release' + Write-Host 'Create new GitHub release' $releaseCreateCommand = @('release', 'create', $newVersion.ToString()) $notesFilePath = $null @@ -125,7 +125,7 @@ LogGroup 'New-GitHubRelease' { if ($usePRTitleAsReleaseName -and $pull_request.title) { $prTitle = $pull_request.title $releaseCreateCommand += @('--title', $prTitle) - Write-Output "Using PR title as release name: [$prTitle]" + Write-Host "Using PR title as release name: [$prTitle]" } else { $releaseCreateCommand += @('--title', $newVersion.ToString()) } @@ -145,14 +145,14 @@ LogGroup 'New-GitHubRelease' { $notesFilePath = [System.IO.Path]::GetTempFileName() Set-Content -Path $notesFilePath -Value $notes -Encoding utf8 $releaseCreateCommand += @('--notes-file', $notesFilePath) - Write-Output 'Using PR title as H1 heading with link and body as release notes' + Write-Host 'Using PR title as H1 heading with link and body as release notes' } elseif ($usePRBodyAsReleaseNotes -and $pull_request.body) { # Path 2: PR body only - no heading, just the body content $prBody = $pull_request.body $notesFilePath = [System.IO.Path]::GetTempFileName() Set-Content -Path $notesFilePath -Value $prBody -Encoding utf8 $releaseCreateCommand += @('--notes-file', $notesFilePath) - Write-Output 'Using PR body as release notes' + Write-Host 'Using PR body as release notes' } else { # Path 3: Fallback to GitHub's auto-generated release notes $releaseCreateCommand += @('--generate-notes') @@ -164,7 +164,7 @@ LogGroup 'New-GitHubRelease' { } if ($whatIf) { - Write-Output "WhatIf: gh $($releaseCreateCommand -join ' ')" + Write-Host "WhatIf: gh $($releaseCreateCommand -join ' ')" } else { $releaseURL = gh @releaseCreateCommand if ($LASTEXITCODE -ne 0) { @@ -180,7 +180,7 @@ LogGroup 'New-GitHubRelease' { $releaseType = if ($createPrerelease) { 'New prerelease' } else { 'New release' } if ($whatIf) { - Write-Output ( + Write-Host ( "gh pr comment $prNumber -b " + "'✅ $releaseType`: GitHub - $name $newVersion'" ) @@ -194,4 +194,4 @@ LogGroup 'New-GitHubRelease' { Write-Host "::notice title=✅ $releaseType`: GitHub - $name $newVersion::$releaseURL" } -Write-Output "Publishing complete. Version: [$($newVersion.ToString())]" +Write-Host "Publishing complete. Version: [$($newVersion.ToString())]" From 348688b6f711e8d280643d5d0704bf9ad6ec3524 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 27 Jan 2026 17:32:57 +0100 Subject: [PATCH 11/15] refactor: Add SuppressMessage attributes for variable usage in script blocks --- src/init.ps1 | 10 +++++++++- src/publish.ps1 | 18 +++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/init.ps1 b/src/init.ps1 index 8320cea..eeeb6a7 100644 --- a/src/init.ps1 +++ b/src/init.ps1 @@ -1,4 +1,12 @@ -[CmdletBinding()] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSUseDeclaredVarsMoreThanAssignments', 'pull_request', + Justification = 'Variable is used in script blocks.' +)] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSUseDeclaredVarsMoreThanAssignments', 'prereleaseName', + Justification = 'Variable is used in script blocks.' +)] +[CmdletBinding()] param() Import-Module -Name 'Helpers' -Force diff --git a/src/publish.ps1 b/src/publish.ps1 index f65748c..793a3b1 100644 --- a/src/publish.ps1 +++ b/src/publish.ps1 @@ -1,4 +1,20 @@ -[CmdletBinding()] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSUseDeclaredVarsMoreThanAssignments', 'apiKey', + Justification = 'Variable is used in script blocks.' +)] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSUseDeclaredVarsMoreThanAssignments', 'usePRBodyAsReleaseNotes', + Justification = 'Variable is used in script blocks.' +)] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSUseDeclaredVarsMoreThanAssignments', 'usePRTitleAsReleaseName', + Justification = 'Variable is used in script blocks.' +)] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute( + 'PSUseDeclaredVarsMoreThanAssignments', 'usePRTitleAsNotesHeading', + Justification = 'Variable is used in script blocks.' +)] +[CmdletBinding()] param() Import-Module -Name 'Helpers' -Force From 0401efa27432d6cf1be4033cf5a026fdf53d0ea2 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 27 Jan 2026 17:48:08 +0100 Subject: [PATCH 12/15] refactor: Enhance output formatting for clarity in init and publish scripts --- src/init.ps1 | 39 +++++++++++++++++++++++++++++---------- src/publish.ps1 | 17 ++++++++--------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/init.ps1 b/src/init.ps1 index eeeb6a7..3a89227 100644 --- a/src/init.ps1 +++ b/src/init.ps1 @@ -59,6 +59,7 @@ LogGroup 'Set configuration' { Write-Host "::warning::$message" } + Write-Host '-------------------------------------------------' [pscustomobject]@{ AutoCleanup = $autoCleanup AutoPatching = $autoPatching @@ -72,17 +73,22 @@ LogGroup 'Set configuration' { MinorLabels = $minorLabels PatchLabels = $patchLabels } | Format-List | Out-String + Write-Host '-------------------------------------------------' } LogGroup 'Event information - JSON' { $githubEventJson = Get-Content $env:GITHUB_EVENT_PATH + Write-Host '-------------------------------------------------' $githubEventJson | Format-List | Out-String + Write-Host '-------------------------------------------------' } LogGroup 'Event information - Object' { $githubEvent = $githubEventJson | ConvertFrom-Json $pull_request = $githubEvent.pull_request + Write-Host '-------------------------------------------------' $githubEvent | Format-List | Out-String + Write-Host '-------------------------------------------------' } LogGroup 'Event information - Details' { @@ -92,19 +98,25 @@ LogGroup 'Event information - Details' { $prHeadRef = $pull_request.head.ref Write-Host '-------------------------------------------------' - Write-Host "PR Head Ref: [$prHeadRef]" - Write-Host "ReleaseType: [$releaseType]" + [PSCustomObject]@{ + PRHeadRef = $prHeadRef + ReleaseType = $releaseType + } | Format-List | Out-String Write-Host '-------------------------------------------------' } LogGroup 'Pull request - details' { + Write-Host '-------------------------------------------------' $pull_request | Format-List | Out-String + Write-Host '-------------------------------------------------' } LogGroup 'Pull request - Labels' { $labels = @() $labels += $pull_request.labels.name + Write-Host '-------------------------------------------------' $labels | Format-List | Out-String + Write-Host '-------------------------------------------------' } LogGroup 'Determine release configuration' { @@ -157,14 +169,16 @@ LogGroup 'Determine release configuration' { } Write-Host '-------------------------------------------------' - Write-Host "ReleaseType: [$releaseType]" - Write-Host "AutoCleanup: [$autoCleanup]" - Write-Host "Should publish: [$shouldPublish]" - Write-Host "Create a release: [$createRelease]" - Write-Host "Create a prerelease: [$createPrerelease]" - Write-Host "Create a major release: [$majorRelease]" - Write-Host "Create a minor release: [$minorRelease]" - Write-Host "Create a patch release: [$patchRelease]" + [PSCustomObject]@{ + ReleaseType = $releaseType + AutoCleanup = $autoCleanup + ShouldPublish = $shouldPublish + CreateRelease = $createRelease + CreatePrerelease = $createPrerelease + CreateMajor = $majorRelease + CreateMinor = $minorRelease + CreatePatch = $patchRelease + } | Format-List | Out-String Write-Host '-------------------------------------------------' } #endregion Calculate release type @@ -183,7 +197,9 @@ if ($shouldPublish -or $autoCleanup) { Write-Error 'Failed to list all releases for the repo.' exit $LASTEXITCODE } + Write-Host '-------------------------------------------------' $releases | Select-Object -Property name, isPrerelease, isLatest, publishedAt | Format-Table | Out-String + Write-Host '-------------------------------------------------' } #endregion Get releases } @@ -193,6 +209,7 @@ if ($shouldPublish) { #region Get versions LogGroup 'Get latest version - GitHub' { $latestRelease = $releases | Where-Object { $_.isLatest -eq $true } + Write-Host '-------------------------------------------------' $latestRelease | Format-List | Out-String $ghReleaseVersionString = $latestRelease.tagName if (-not [string]::IsNullOrEmpty($ghReleaseVersionString)) { @@ -338,7 +355,9 @@ if ($shouldPublish) { if ($autoCleanup) { LogGroup 'Find prereleases to cleanup' { $prereleasesToCleanup = $releases | Where-Object { $_.tagName -like "*$prereleaseName*" } + Write-Host '-------------------------------------------------' $prereleasesToCleanup | Select-Object -Property name, publishedAt, isPrerelease, isLatest | Format-Table | Out-String + Write-Host '-------------------------------------------------' $prereleaseTagsToCleanup = ($prereleasesToCleanup | ForEach-Object { $_.tagName }) -join ',' Write-Host "Prereleases to cleanup: [$prereleaseTagsToCleanup]" } diff --git a/src/publish.ps1 b/src/publish.ps1 index 793a3b1..f697755 100644 --- a/src/publish.ps1 +++ b/src/publish.ps1 @@ -52,15 +52,14 @@ LogGroup 'Load publish context from environment' { $newVersion = New-PSSemVer -Version $newVersionString - Write-Host '-------------------------------------------------' - Write-Host 'Publish context:' - Write-Host " CreateRelease: [$createRelease]" - Write-Host " CreatePrerelease: [$createPrerelease]" - Write-Host " NewVersion: [$($newVersion.ToString())]" - Write-Host " PRNumber: [$prNumber]" - Write-Host " PRHeadRef: [$prHeadRef]" - Write-Host " WhatIf: [$whatIf]" - Write-Host '-------------------------------------------------' + [PSCustomObject]@{ + CreateRelease = $createRelease + CreatePrerelease = $createPrerelease + NewVersion = $newVersion.ToString() + PRNumber = $prNumber + PRHeadRef = $prHeadRef + WhatIf = $whatIf + } | Format-List | Out-String } LogGroup 'Load PR information' { From 3747ea62b3c57b5a22b1c9f337e196dfce69a94f Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 27 Jan 2026 17:52:09 +0100 Subject: [PATCH 13/15] style: Adjust formatting for release configuration output for consistency --- src/init.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/init.ps1 b/src/init.ps1 index 3a89227..fcc37c4 100644 --- a/src/init.ps1 +++ b/src/init.ps1 @@ -170,14 +170,14 @@ LogGroup 'Determine release configuration' { Write-Host '-------------------------------------------------' [PSCustomObject]@{ - ReleaseType = $releaseType - AutoCleanup = $autoCleanup - ShouldPublish = $shouldPublish - CreateRelease = $createRelease - CreatePrerelease = $createPrerelease - CreateMajor = $majorRelease - CreateMinor = $minorRelease - CreatePatch = $patchRelease + ReleaseType = $releaseType + AutoCleanup = $autoCleanup + ShouldPublish = $shouldPublish + CreateRelease = $createRelease + CreatePrerelease = $createPrerelease + CreateMajor = $majorRelease + CreateMinor = $minorRelease + CreatePatch = $patchRelease } | Format-List | Out-String Write-Host '-------------------------------------------------' } From f727252129f5f11bb66ddeddd5ecfc5dd0f000e5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 27 Jan 2026 19:13:41 +0100 Subject: [PATCH 14/15] style: Set output rendering to ANSI for consistent formatting across scripts --- src/cleanup.ps1 | 2 ++ src/init.ps1 | 2 ++ src/publish.ps1 | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/cleanup.ps1 b/src/cleanup.ps1 index 7a11de0..cc2fc6e 100644 --- a/src/cleanup.ps1 +++ b/src/cleanup.ps1 @@ -1,6 +1,8 @@ [CmdletBinding()] param() +$PSStyle.OutputRendering = 'Ansi' + Import-Module -Name 'Helpers' -Force $prereleaseName = $env:PUBLISH_CONTEXT_PrereleaseName diff --git a/src/init.ps1 b/src/init.ps1 index fcc37c4..37e6205 100644 --- a/src/init.ps1 +++ b/src/init.ps1 @@ -9,6 +9,8 @@ [CmdletBinding()] param() +$PSStyle.OutputRendering = 'Ansi' + Import-Module -Name 'Helpers' -Force LogGroup 'Install dependencies' { diff --git a/src/publish.ps1 b/src/publish.ps1 index f697755..751c6b4 100644 --- a/src/publish.ps1 +++ b/src/publish.ps1 @@ -17,6 +17,8 @@ [CmdletBinding()] param() +$PSStyle.OutputRendering = 'Ansi' + Import-Module -Name 'Helpers' -Force LogGroup 'Load inputs' { From 1677b7520ad7ce0baa1813aee00347006c082bfd Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 27 Jan 2026 19:25:33 +0100 Subject: [PATCH 15/15] style: Improve output formatting by adding separators in init and publish scripts --- src/init.ps1 | 3 ++- src/publish.ps1 | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/init.ps1 b/src/init.ps1 index 37e6205..aec82f3 100644 --- a/src/init.ps1 +++ b/src/init.ps1 @@ -345,7 +345,8 @@ if ($shouldPublish) { } Write-Host '-------------------------------------------------' Write-Host 'New version:' - Write-Host ($newVersion | Format-Table | Out-String) + $newVersion | Format-Table | Out-String + Write-Host '-------------------------------------------------' Write-Host $newVersion.ToString() Write-Host '-------------------------------------------------' } diff --git a/src/publish.ps1 b/src/publish.ps1 index 751c6b4..7e4afc3 100644 --- a/src/publish.ps1 +++ b/src/publish.ps1 @@ -54,6 +54,7 @@ LogGroup 'Load publish context from environment' { $newVersion = New-PSSemVer -Version $newVersionString + Write-Host '-------------------------------------------------' [PSCustomObject]@{ CreateRelease = $createRelease CreatePrerelease = $createPrerelease @@ -62,6 +63,7 @@ LogGroup 'Load publish context from environment' { PRHeadRef = $prHeadRef WhatIf = $whatIf } | Format-List | Out-String + Write-Host '-------------------------------------------------' } LogGroup 'Load PR information' {