Skip to content

Commit 9269d88

Browse files
jaysin586claude
andauthored
fix(ci): always run release cleanup on failure (#153)
The "Cleanup on failure" step in npm-publish.yml was gated on `failure() && steps.create_release.outcome == 'success'`, so if `gh release create` itself failed, cleanup was skipped and the bumped commit/tag were left pushed with no npm/GitHub release. Drop the create_release gate (`if: failure()`) and add `|| true` to the cleanup commands so one missing artifact doesn't abort the rest. Same fix as humanspeak/svelte-purify (CodeRabbit finding). Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 4ea020f commit 9269d88

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ jobs:
514514
pnpm publish --provenance --access public --no-git-checks
515515
516516
- name: Cleanup on failure
517-
if: failure() && steps.create_release.outcome == 'success'
517+
if: failure()
518518
env:
519519
RELEASE_VERSION: ${{ steps.version.outputs.new_version }}
520520
GITHUB_TOKEN: ${{ secrets.ACTIONS_KEY }}
@@ -526,9 +526,9 @@ jobs:
526526
fi
527527
528528
# Proceed with cleanup only if validation passes
529-
gh release delete "$RELEASE_VERSION" --yes
530-
git tag -d "$RELEASE_VERSION"
531-
git push --delete origin "$RELEASE_VERSION"
529+
gh release delete "$RELEASE_VERSION" --yes || true
530+
git tag -d "$RELEASE_VERSION" || true
531+
git push --delete origin "$RELEASE_VERSION" || true
532532
533533
- name: Notify on failure
534534
if: failure()

0 commit comments

Comments
 (0)