Skip to content

ci: fix publish failing with empty version on draft releases - #80

Merged
kerem-acer merged 1 commit into
mainfrom
fix/publish-empty-version-on-draft-release
Jun 30, 2026
Merged

ci: fix publish failing with empty version on draft releases#80
kerem-acer merged 1 commit into
mainfrom
fix/publish-empty-version-on-draft-release

Conversation

@kerem-acer

Copy link
Copy Markdown
Contributor

Problem

The v0.1.41 publish run failed at the Publish packages step:

error: package.json `name` and `version` fields must be non-empty strings

Root cause

The v0.1.41 release was created as a draft (2026-06-25) and published later (2026-06-30). For releases published from a draft, GITHUB_REF_NAME does not resolve to the tag — it came back empty.

The Extract version from tag step (echo "VERSION=${GITHUB_REF_NAME#v}") therefore produced an empty VERSION. The next step ran jq '.version = ""' and wrote an empty version into all six published package.json files. bun build/bun test don't validate version, so the failure only surfaced at bun publish.

v0.1.40 succeeded because it was published directly (the tag existed), so GITHUB_REF_NAME was set.

Confirmed in the logs:

  • v0.1.40 (success): Run VERSION=0.1.40
  • v0.1.41 (failure): Run VERSION= (empty)

Fix

  • Read the version from the canonical github.event.release.tag_name, which is populated for release events regardless of draft origin.
  • Fail the job immediately if the version resolves empty, so we never silently publish corrupt manifests again.

Follow-up

The v0.1.41 tag predates this fix, so re-running the failed job would still use the old workflow. To actually ship the unpublished 0.1.41 packages, cut a fresh release (e.g. v0.1.42) from main after this merges.

🤖 Generated with Claude Code

When a release is published from a draft, GITHUB_REF_NAME does not resolve
to the tag and comes back empty. The "Update package versions" step then ran
`jq '.version = ""'`, writing empty version fields into every package.json.
build/test don't validate version, so the failure only surfaced at
`bun publish` ("name and version fields must be non-empty strings"), as in
the v0.1.41 release run.

Read the version from the canonical github.event.release.tag_name instead,
and fail the job immediately if it resolves empty so we never publish
corrupt manifests silently again.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kerem-acer
kerem-acer merged commit 9eec9af into main Jun 30, 2026
2 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.

1 participant