From 799f7328e8345e80f25230cb0bd75dfa82a20a2f Mon Sep 17 00:00:00 2001 From: Jason Kummerl Date: Wed, 27 May 2026 21:48:45 -0400 Subject: [PATCH] fix(ci): always run release cleanup on failure 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 --- .github/workflows/npm-publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 401a080..a85363f 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -514,7 +514,7 @@ jobs: pnpm publish --provenance --access public --no-git-checks - name: Cleanup on failure - if: failure() && steps.create_release.outcome == 'success' + if: failure() env: RELEASE_VERSION: ${{ steps.version.outputs.new_version }} GITHUB_TOKEN: ${{ secrets.ACTIONS_KEY }} @@ -526,9 +526,9 @@ jobs: fi # Proceed with cleanup only if validation passes - gh release delete "$RELEASE_VERSION" --yes - git tag -d "$RELEASE_VERSION" - git push --delete origin "$RELEASE_VERSION" + gh release delete "$RELEASE_VERSION" --yes || true + git tag -d "$RELEASE_VERSION" || true + git push --delete origin "$RELEASE_VERSION" || true - name: Notify on failure if: failure()