Skip to content

fix(ci): make GitHub release step idempotent#252

Merged
pratyush618 merged 1 commit into
masterfrom
fix/idempotent-gh-release
Jun 12, 2026
Merged

fix(ci): make GitHub release step idempotent#252
pratyush618 merged 1 commit into
masterfrom
fix/idempotent-gh-release

Conversation

@pratyush618

@pratyush618 pratyush618 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Problem

Run 27393170986 published 0.16.1 to PyPI successfully, but the publish job still went red. The final Create GitHub release step failed with HTTP 422: Release.tag_name already exists because a release for the tag already existed.

A red job after a successful upload is misleading and breaks reruns.

Fix

Skip gh release create when the release already exists.

Summary by CodeRabbit

  • Chores
    • Improved the release process to prevent duplicate releases by verifying release existence before creation.

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.
@github-actions github-actions Bot added the ci label Jun 12, 2026
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ab5fd316-e6b2-401a-a2d9-42a44c706b82

📥 Commits

Reviewing files that changed from the base of the PR and between 43836ec and 3f4141a.

📒 Files selected for processing (1)
  • .github/workflows/publish.yml

📝 Walkthrough

Walkthrough

The 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.

Changes

Release Creation Safety Check

Layer / File(s) Summary
Conditional GitHub release creation
.github/workflows/publish.yml
The release creation step transitions from unconditional gh release create to a conditional probe-first flow using gh release view. If a release exists, it logs a notice and skips; otherwise it creates the release with title and auto-generated notes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • ByteVeda/taskito#248: Modifies gh release create logic in the same publish workflow around release creation steps.
  • ByteVeda/taskito#250: Modifies the publish workflow's GitHub release creation conditional behavior.

Suggested labels

ci

Poem

🐰 A wise rabbit checks before it hops—
Does the release exist? The workflow stops!
No duplicate burrows in the GitHub sky,
Idempotent publishes make systems sigh. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly addresses the main change: making the GitHub release step idempotent by checking if a release exists before creation, as detailed in both the raw summary and PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/idempotent-gh-release

Comment @coderabbitai help to get the list of available commands and usage tips.

@pratyush618
pratyush618 merged commit 2c78d26 into master Jun 12, 2026
16 checks passed
@pratyush618
pratyush618 deleted the fix/idempotent-gh-release branch June 12, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant