fix(ci): make GitHub release step idempotent#252
Conversation
Tag-push reruns and pre-existing releases made gh release create fail with 422, marking publish red after a successful PyPI upload. Skip when the release already exists.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe publish workflow's release creation step adds an idempotency check: it now verifies whether a GitHub release already exists for the resolved version before attempting creation, logging a notice if found and skipping the operation to avoid duplicate release errors. ChangesRelease Creation Safety Check
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Problem
Run 27393170986 published 0.16.1 to PyPI successfully, but the
publishjob still went red. The finalCreate GitHub releasestep failed withHTTP 422: Release.tag_name already existsbecause a release for the tag already existed.A red job after a successful upload is misleading and breaks reruns.
Fix
Skip
gh release createwhen the release already exists.Summary by CodeRabbit