Skip to content

fix(publish): preserve scope in publish attachment key and tarball URI#478

Merged
colinhacks merged 1 commit into
mainfrom
pullfrog/477-scoped-publish-attachment-key
Jul 21, 2026
Merged

fix(publish): preserve scope in publish attachment key and tarball URI#478
colinhacks merged 1 commit into
mainfrom
pullfrog/477-scoped-publish-attachment-key

Conversation

@pullfrog

@pullfrog pullfrog Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Problem

Publishing a scoped package to GitHub Packages fails with:

400 Bad Request: {"error":"no attachments present in packument"}

build_publish_body keyed both _attachments and the dist.tarball URI by archive.filename, which is the on-disk nub pack name. pack::tarball_filename flattens the scope (@scope/pkgscope-pkg), so the publish body advertised oisin-ee-momokaya-brand-0.1.2.tgz instead of the scope-preserving @oisin-ee/momokaya-brand-0.1.2.tgz that GitHub Packages requires. npm's libnpmpublish uses ${manifest.name}-${manifest.version}.tgz (scope intact) for both, so this is a divergence from the reference protocol.

Fix

Add publish_attachment_name (<name>-<version>.tgz, scope preserved) and use it for the _attachments key and the tarball URI. The flattened nub pack filename and the --json filename field are unchanged, keeping npm-compatible pack output intact.

The provenance attachment already used archive.name (scoped), so only the tarball attachment was affected.

Test

publish_body_uses_scoped_attachment_key_and_tarball_uri asserts the serialized body keys _attachments and dist.tarball by the scoped form for @oisin-ee/momokaya-brand, with no live registry needed. Verified locally: all 25 commands::publish tests pass.

Closes #477

Pullfrog  | View workflow run | via Pullfrog | Using Claude Opus𝕏

The publish packument keyed `_attachments` and the `dist.tarball` URI by
the on-disk pack filename, which flattens `@scope/pkg` to `scope-pkg`.
GitHub Packages requires the scope-preserving `@scope/pkg-<version>.tgz`
form for scoped packages and otherwise rejects the PUT with `no
attachments present in packument`.

Use a dedicated `publish_attachment_name` (`<name>-<version>.tgz`,
matching npm's libnpmpublish) for the attachment key and tarball URI,
leaving the flattened `nub pack` filename unchanged.
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nub Ready Ready Preview, Comment Jul 15, 2026 8:10am

Request Review

@colinhacks
colinhacks merged commit 89c8915 into main Jul 21, 2026
52 checks passed
@colinhacks

Copy link
Copy Markdown
Contributor

Shipped in v0.5.0: https://github.com/nubjs/nub/releases/tag/v0.5.0

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.

publish: GitHub Packages rejects scoped packument attachment

1 participant