Skip to content

fix(publish): anchor gh release create to GITHUB_SHA to avoid untagged release#506

Merged
jdx merged 1 commit into
mainfrom
chore/use-communique
Feb 18, 2026
Merged

fix(publish): anchor gh release create to GITHUB_SHA to avoid untagged release#506
jdx merged 1 commit into
mainfrom
chore/use-communique

Conversation

@jdx

@jdx jdx commented Feb 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • The v2.17.1 release CI run failed because gh release create --draft "v2.17.1" created a release with tag untagged-d8ea426c8964292e5b9a instead of v2.17.1
  • taiki-e/upload-rust-binary-action could not find the release by tag name, failing all build-and-publish matrix jobs
  • Root cause: the new communique-based workflow calls gh release create almost immediately after checkout, whereas the old workflow had a ~60s npm install -g @anthropic-ai/claude-code step first. Without that delay, gh hits a race condition where GitHub's Releases API hasn't indexed the newly-pushed tag yet, so it falls back to creating an untagged-* draft

Fix

Add --target "$GITHUB_SHA" to gh release create. This anchors the release to the exact commit SHA from the workflow trigger, bypassing the GitHub Releases API's tag lookup entirely. The release is still associated with the tag name v2.17.1 but doesn't depend on the API having indexed the tag yet.

Test plan

  • Verify next release run creates a draft release with the correct tag (not untagged-*)
  • Confirm taiki-e/upload-rust-binary-action can find the release and upload binaries

🤖 Generated with Claude Code


Note

Low Risk
Small CI workflow change limited to release creation behavior; low risk aside from potentially changing which commit a tag’s release points to if the tag is mis-pushed.

Overview
Ensures the publish-cli workflow always creates draft GitHub releases for the exact commit that triggered the run by adding --target "$GITHUB_SHA" to gh release create.

This avoids occasional untagged-* draft releases (and downstream publish failures) when the tag hasn’t propagated/indexed yet at release-creation time.

Written by Cursor Bugbot for commit 571ac7e. This will update automatically on new commits. Configure here.

…d release

Without --target, gh release create resolves the tag via the GitHub API
which can race with tag propagation and create an untagged-* draft release
that taiki-e/upload-rust-binary-action cannot find by tag name.

Explicitly passing --target "$GITHUB_SHA" bypasses the tag lookup and
anchors the release to the exact commit SHA from the triggering event.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 18, 2026 12:55
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@codecov

codecov Bot commented Feb 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.88%. Comparing base (e7c2717) to head (571ac7e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #506   +/-   ##
=======================================
  Coverage   77.88%   77.88%           
=======================================
  Files          48       48           
  Lines        6660     6660           
  Branches     6660     6660           
=======================================
  Hits         5187     5187           
  Misses       1109     1109           
  Partials      364      364           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the release-publishing GitHub Actions workflow to prevent gh release create from creating untagged-* draft releases when a tag push hasn’t been indexed by GitHub’s Releases API yet, by anchoring the release creation to the workflow’s commit SHA.

Changes:

  • Add --target "$GITHUB_SHA" to gh release create to bind the release to the triggering commit SHA.
  • Keep the release tag name (v*) unchanged while avoiding the tag-lookup race condition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jdx jdx merged commit e3243cc into main Feb 18, 2026
17 checks passed
@jdx jdx deleted the chore/use-communique branch February 18, 2026 13:02
jdx pushed a commit that referenced this pull request Feb 18, 2026
### 🐛 Bug Fixes

- **(publish)** anchor gh release create to GITHUB_SHA to avoid untagged
release by [@jdx](https://github.com/jdx) in
[#506](#506)
jdx added a commit that referenced this pull request Feb 18, 2026
…_name (#508)

## Summary

- Previous fix (#506) added `--target "$GITHUB_SHA"` to `gh release
create`, but the releases are still created as `untagged-*`
- Root cause (revised): something creates a GitHub release for the tag
~60 seconds before the `publish-cli` workflow starts (timestamps:
v2.17.1 release at 12:36:44, workflow start at 12:37:44; v2.17.2 release
at 13:07:56, workflow start at 13:08:47). When `gh release create
"v2.17.x"` finds an existing release for that tag, it silently creates a
new `untagged-*` draft as a fallback instead of failing
- Fix: call `gh api repos/${{ github.repository }}/releases --method
POST` directly with explicit `-f tag_name=` and `-f target_commitish=`
fields. This bypasses the `gh release create` wrapper entirely and
guarantees the `tag_name` is set correctly regardless of pre-existing
releases

## Test plan

- [ ] Verify next release creates a draft with `tag_name: v2.x.x` (not
`untagged-*`) via `gh api repos/jdx/usage/releases --jq '.[0]'`
- [ ] Confirm `taiki-e/upload-rust-binary-action` finds the release and
uploads binaries successfully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Small, workflow-only change affecting how GitHub releases are created;
primary risk is misconfigured API parameters causing draft release
creation to fail.
> 
> **Overview**
> Fixes the `publish-cli` workflow’s draft release creation to avoid
accidental `untagged-*` releases when a release already exists for a
just-pushed tag.
> 
> Replaces `gh release create` with a direct `gh api POST
/repos/{owner}/{repo}/releases`, explicitly setting `tag_name`,
`target_commitish`, and the changelog-derived release body before
continuing with the existing release-notes enhancement and publish
steps.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8ecbb58. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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