Repository navigation
ci: make release creation idempotent when tag already exists - #9
Conversation
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
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
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
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.
…ot found Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: odykyi <24225497+odykyi@users.noreply.github.com>
|
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. |
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
🚀 Releaseworkflow for tagv0.2.1failed 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
gh release createcommand; no unit tests exist for the workflow itself, and none were added (workflow tests would require additional infrastructure).python3 -m unittest tests.test_rules -v) continue to run unchanged in the workflow.Notes
The original failing run for
v0.2.1is explained by the race described in the issue. This change prevents the same failure on future re-runs or double-triggers.