Skip to content

ci: make release creation idempotent when tag already exists - #9

Merged
odykyi merged 2 commits into
flisk-sh:mainfrom
HarshRajSinghania:fix/release-idempotent
Nov 16, 2026
Merged

odykyi merged 2 commits into
flisk-sh:mainfrom
HarshRajSinghania:fix/release-idempotent

Conversation

@HarshRajSinghania

Copy link
Copy Markdown
Contributor

Summary

Makes the release workflow idempotent so that re-running it for a tag that already has a GitHub release succeeds instead of failing with HTTP 422 "tag_name already exists".

Motivation

Fixes #8. The 🚀 Release workflow for tag v0.2.1 failed on the "Create release" step even though the release had already been published a few seconds earlier. The create step was not idempotent.

Implementation

In .github/workflows/release.yml, the "Create release" step now checks whether a release for the tag already exists (gh release view "$TAG"). If it does, the step logs a notice and skips creation. Otherwise it creates the release as before. Real failures (network errors, permission issues, invalid tags, etc.) still cause the step to fail.

No other files were changed.

Testing

  • Reviewed the diff for correctness against the reported failure mode.
  • The change is a small conditional around the existing gh release create command; no unit tests exist for the workflow itself, and none were added (workflow tests would require additional infrastructure).
  • Existing unit tests (python3 -m unittest tests.test_rules -v) continue to run unchanged in the workflow.

Notes

The original failing run for v0.2.1 is explained by the race described in the issue. This change prevents the same failure on future re-runs or double-triggers.

Check for an existing release before creating one so that re-running
the workflow for a tag that already has a release succeeds instead of
failing with HTTP 422 tag_name already exists.

Fixes flisk-sh#8
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1df7d055-2540-4b79-aa71-dc15f5c9dc3e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@llamapreview llamapreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LlamaPReview — Blocking issues found

Concurrent attempts still fail, and lookup errors are mistaken for an absent release

Owner action: Distinguish confirmed absence from other lookup failures, report and fail on lookup errors, and handle an already-exists result at creation time by confirming the release for the tag without swallowing unrelated create failures.

1 further item in details.

Risk path

Both same-tag attempts can pass the new lookup before either creates the release.

sequenceDiagram
participant A as Attempt A
participant B as Attempt B
participant G as Release API
A->>G: View tag#59; no release found
B->>G: View tag#59; no release found
note over A,B: PR change — both attempts can pass the new existence check before either creates
critical
A->>G: Create release for tag
B->>G: Create release for same tag
G-->>A: Release created
G-->>B: Duplicate-create failure
end
note over A,B: Impact — the concurrent attempt can still fail
Loading
Review details and evidence
Priority File Finding Evidence
P2 .github/workflows/release.yml Concurrent attempts still fail, and lookup errors are mistaken for an absent release confirmed

Material unknowns

  • Whether the full README already satisfies the documentation acceptance criterion is unknown; only an excerpt was supplied. This documentation status remains unknown but does not change the blocking posture.
    • Check: Check the full README against the documentation acceptance criterion.

LlamaPReview checks

  • Reviewed changed regions in .github/workflows/release.yml.
  • Read the complete PR-head file .github/workflows/release.yml.
  • Inspected matching PR-head repository snippets in README.md, .github/workflows/release.yml.

LlamaPReview is open source. Explore the code behind this review.

Comment thread .github/workflows/release.yml Resolved
…ot found

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: odykyi <24225497+odykyi@users.noreply.github.com>
@odykyi

odykyi commented Nov 16, 2026

Copy link
Copy Markdown
Member

Fixed in e10cc22: added a per-tag concurrency group so two runs for one tag are serialized; creation now happens only when the lookup says "release not found" (any other lookup error fails with its output shown); and if create fails, a re-check of the release makes a concurrent creation count as success.

@odykyi
odykyi merged commit d6afa0c into flisk-sh:main Nov 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(release): release workflow fails with 422 tag_name already exists when the release was already published

2 participants