You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: label & link GitHub Packages releases correctly (#123) (#124)
Closes#123
## Problem
When publishing to **GitHub Packages** (`npm.pkg.github.com`), bumpy
labelled the target `npm` in the GitHub release notes and in `bumpy
status` / `bumpy ci plan` output, and the "Published to" badge linked to
a **non-existent npmjs.com page** (404). The actual publish went to the
right registry — only the reported label/URL was wrong.
Reported with a [minimal
reproduction](https://github.com/Shtian/bumpy-github-packages-repro) by
@Shtian. The `buildPublishUrl` `_registry` argument was unused — the
registry was ignored at every reporting site.
## Fix
`buildPublishUrl` now honours the configured registry (resolved from the
bumpy `registry` config, falling back to `publishConfig.registry` in
`package.json`):
- **GitHub Packages** → target is labelled **GitHub Packages** and links
to the package page under the repo:
`https://github.com/<owner>/<repo>/pkgs/npm/<name>`. The `owner/repo` is
resolved from the package's `repository` field, falling back to
`GITHUB_REPOSITORY` in CI.
- **Other custom/private registries** → no longer emit a dead npmjs.com
link (no canonical browsable URL).
- **Default npmjs registry / no registry** → unchanged.
GitHub Packages has no per-version page, so the URL points at the
package page (which lists versions).
### Sites touched
- `buildPublishUrl` — honours `registry` + `repoSlug`; new
`isGitHubPackagesRegistry`, `publishTargetLabel`,
`resolvePackageRegistry`, `parseRepoSlug` helpers
(core/github-release.ts)
- Release notes "Published to" section — uses a per-target `label`
(defaults to the target key)
- `publish` command — computes registry/repo context per package and
stamps label + URL into release metadata
- `status` / `ci plan` JSON output — `publishTargets` now include
`label` + `registry`
## Tests
Added coverage for `buildPublishUrl` (GHP, default, custom-registry,
missing-repo cases), `isGitHubPackagesRegistry`, `publishTargetLabel`,
`resolvePackageRegistry`, `parseRepoSlug`, and label rendering in
`formatPublishedToSection`. Full suite passes (327 tests); lint, format,
and typecheck clean.
Label and link npm targets published to GitHub Packages correctly. Packages publishing to a GitHub Packages registry (`npm.pkg.github.com`) were labelled `npm` in the GitHub release notes and `bumpy status`/`bumpy ci plan` output, with a "Published to" badge linking to a non-existent npmjs.com page (404). The configured registry is now honoured: such targets are labelled **GitHub Packages** and link to the package page under the repo (`https://github.com/<owner>/<repo>/pkgs/npm/<name>`), resolving the repo from the package's `repository` field or `GITHUB_REPOSITORY`. Other custom/private registries no longer emit a dead npmjs.com link. `buildPublishUrl` now honours its registry argument (previously the unused `_registry` param).
0 commit comments