Skip to content

Commit e55d32f

Browse files
tablackburnclaude
andcommitted
ci(release): allow PSGallery publish to recover when the release already exists
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) <noreply@anthropic.com>
1 parent e3d324f commit e55d32f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/PublishModuleToPowerShellGallery.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ jobs:
6666
6767
- name: Check if PSGallery Version Exists
6868
id: check_psgallery
69-
if: steps.check_release.outputs.exists == 'false'
69+
# Run regardless of whether the GitHub release exists, so a release that was
70+
# created but never published can still be recovered (see Publish gating below).
71+
if: steps.template_guard.outputs.is_template == 'false'
7072
shell: pwsh
7173
env:
7274
VERSION: ${{ steps.version.outputs.version }}
@@ -82,7 +84,7 @@ jobs:
8284
}
8385
8486
- name: Bootstrap
85-
if: steps.check_release.outputs.exists == 'false'
87+
if: steps.check_release.outputs.exists == 'false' || steps.check_psgallery.outputs.exists == 'false'
8688
shell: pwsh
8789
run: ./build.ps1 -Task Init -Bootstrap
8890

@@ -144,7 +146,7 @@ jobs:
144146
}
145147
146148
- name: Publish to PSGallery
147-
if: steps.check_release.outputs.exists == 'false' && steps.check_psgallery.outputs.exists == 'false'
149+
if: steps.check_psgallery.outputs.exists == 'false'
148150
shell: pwsh
149151
env:
150152
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}

0 commit comments

Comments
 (0)