Commit 7a20ca8
fix(publish): authenticate to GitHub Packages before installing (#92)
A package whose own dependencies live on GitHub Packages could not be
released. Both publish blocks ran `bun install` with no registry credentials,
so a private first-party dependency failed with 401 then 403 and the publish
step never ran. connect-basic hit this on v0.10.0: the version was bumped and
the GitHub Release created, but no artifact was ever published.
The token is now written to ~/.npmrc before install. Deliberately credentials
only — no scope mapping. The existing ordering comment explains why the
owner's scope must not be remapped this early: a package being published to
both registries for the first time would stop resolving its own npmjs.org
scope-siblings. Supplying a token for the host without touching the registry
mapping fixes the install and preserves that property, because a repository
that genuinely routes a scope to GitHub Packages already declares it in its
own .npmrc.
This is latent for any published package with a first-party dependency, not
specific to connect-basic — hono-ts uses this workflow and carries
@photon-hq/error as a devDependency.
publish-npm has the same shape and is not covered here: it only accepts an
npm-token, so giving it GitHub Packages credentials means a new input, and no
package currently publishes to npmjs.org with a private first-party dependency.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 43f12a6 commit 7a20ca8
2 files changed
Lines changed: 28 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
44 | 59 | | |
45 | | - | |
46 | | - | |
| 60 | + | |
47 | 61 | | |
48 | 62 | | |
49 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
45 | 57 | | |
46 | 58 | | |
47 | 59 | | |
| |||
0 commit comments