From e55d32f4d429c5ae90a9bd927d930b4987308c48 Mon Sep 17 00:00:00 2001 From: Trent Blackburn Date: Thu, 21 May 2026 20:08:35 -0400 Subject: [PATCH] ci(release): allow PSGallery publish to recover when the release already exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The publish step (and PSGallery existence check) were gated on 'GitHub release does not exist', so a run that created the release but failed to publish to PSGallery could never recover — re-runs skipped publishing entirely. Regate (matching PlexAutomationToolkit's existing pattern): - Check if PSGallery Version Exists: runs whenever not the un-initialized template (no longer gated on the release check). - Bootstrap: runs if a release needs creating OR a publish is needed. - Publish to PSGallery: gated only on the PSGallery check (publish if the version isn't on the gallery, regardless of whether the GitHub release exists). - Create GitHub Release: unchanged (still skipped if the release exists). Flagged by both CodeRabbit and Copilot during the YouTubeMusicPS rollout review. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/PublishModuleToPowerShellGallery.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/PublishModuleToPowerShellGallery.yaml b/.github/workflows/PublishModuleToPowerShellGallery.yaml index df7c81f..9e83099 100644 --- a/.github/workflows/PublishModuleToPowerShellGallery.yaml +++ b/.github/workflows/PublishModuleToPowerShellGallery.yaml @@ -66,7 +66,9 @@ jobs: - name: Check if PSGallery Version Exists id: check_psgallery - if: steps.check_release.outputs.exists == 'false' + # Run regardless of whether the GitHub release exists, so a release that was + # created but never published can still be recovered (see Publish gating below). + if: steps.template_guard.outputs.is_template == 'false' shell: pwsh env: VERSION: ${{ steps.version.outputs.version }} @@ -82,7 +84,7 @@ jobs: } - name: Bootstrap - if: steps.check_release.outputs.exists == 'false' + if: steps.check_release.outputs.exists == 'false' || steps.check_psgallery.outputs.exists == 'false' shell: pwsh run: ./build.ps1 -Task Init -Bootstrap @@ -144,7 +146,7 @@ jobs: } - name: Publish to PSGallery - if: steps.check_release.outputs.exists == 'false' && steps.check_psgallery.outputs.exists == 'false' + if: steps.check_psgallery.outputs.exists == 'false' shell: pwsh env: PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}