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 }}