Skip to content

fix(ci): release workflow is idempotent against an already-existing release - #105

Merged
open-coder-ai merged 1 commit into
mainfrom
fix/release-workflow-idempotent-against-existing-tag
Sep 2, 2026
Merged

fix(ci): release workflow is idempotent against an already-existing release#105
open-coder-ai merged 1 commit into
mainfrom
fix/release-workflow-idempotent-against-existing-tag

Conversation

@open-coder-ai

Copy link
Copy Markdown
Owner

What

The v0.8.0 release exposed a real, recurring bug in .github/workflows/release.yml's release job. Its practice is to create the GitHub Release via the UI first (which creates the tag and the published release together) — that tag push is what triggers this workflow. By the time the release job runs, gh release create always finds the release object already there and fails: gh release create "$GITHUB_REF_NAME" ... errors on an existing release.

PyPI publish (the pypi job) is independent and had already succeeded — v0.8.0 is correctly on PyPI. But the failed release job step meant the platform binaries and their checksums were never attached to the release, silently, every time this has run this way.

The fix

Try gh release upload "$GITHUB_REF_NAME" dist/chock* dist/checksums.txt --clobber against the release that (almost always) already exists; fall back to the original gh release create only when none does, so a tag pushed without a pre-existing release (e.g. directly via git push --tags) still gets one. Doesn't touch the release's title or notes when it already exists — only attaches assets.

Verification

  • python3 -c "import yaml; yaml.safe_load(...)" — YAML parses clean.
  • Extracted the shell block and ran bash -n — syntax clean. (zizmor/actionlint need authenticated GitHub API access this local check didn't have; CI runs both.)
  • Confirmed against the actual v0.8.0 failure: run 33624211179, release job, "Create GitHub Release" step — gh release create failing exactly as diagnosed.

Note

v0.8.0's release (https://github.com/open-coder-ai/chock/releases/tag/v0.8.0) currently has zero attached assets as a result of this bug. This PR prevents it recurring on the next tag; it doesn't retroactively attach v0.8.0's binaries (this session has no gh release upload access outside this workflow). If the platform binaries matter for v0.8.0 specifically, they can be downloaded from that same failed run's artifacts and uploaded by hand.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RcphZmVVXoy8Jf2tUtcsC3


Generated by Claude Code

…elease

v0.8.0 exposed a real bug: the owner creates the GitHub Release via the UI (which
creates the tag and the published release together), and that tag push is what
triggers this workflow -- so `gh release create` always finds the release object
already there and fails. PyPI publish had already succeeded by then, so the release
went out with the right notes but zero attached binaries/checksums, silently, every
time.

Try `gh release upload ... --clobber` against the release that (almost always)
already exists first; fall back to `gh release create` only if none does, so a tag
pushed without a pre-existing release still gets one. Doesn't touch the owner's
release title/notes when the release already exists.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

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

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 73b3d057-2213-40b6-82a9-74409daf2cf7


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

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

@open-coder-ai
open-coder-ai merged commit 37f22ae into main Sep 2, 2026
16 checks 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.

2 participants