fix: label & link GitHub Packages releases correctly (#123)#124
Merged
Conversation
Packages published to a GitHub Packages registry (npm.pkg.github.com) were labelled "npm" in release notes and status/ci plan output, with a badge linking to a 404 npmjs.com page. buildPublishUrl now honours the configured registry: - npm targets on a GHP registry are labelled "GitHub Packages" and link to the package page under the repo (resolved from package.json repository or GITHUB_REPOSITORY) - other custom/private registries no longer emit a dead npmjs.com link Closes #123
|
The changes in this PR will be included in the next version bump.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Closes #123
Problem
When publishing to GitHub Packages (
npm.pkg.github.com), bumpy labelled the targetnpmin the GitHub release notes and inbumpy status/bumpy ci planoutput, 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 by @Shtian. The
buildPublishUrl_registryargument was unused — the registry was ignored at every reporting site.Fix
buildPublishUrlnow honours the configured registry (resolved from the bumpyregistryconfig, falling back topublishConfig.registryinpackage.json):https://github.com/<owner>/<repo>/pkgs/npm/<name>. Theowner/repois resolved from the package'srepositoryfield, falling back toGITHUB_REPOSITORYin CI.GitHub Packages has no per-version page, so the URL points at the package page (which lists versions).
Sites touched
buildPublishUrl— honoursregistry+repoSlug; newisGitHubPackagesRegistry,publishTargetLabel,resolvePackageRegistry,parseRepoSlughelpers (core/github-release.ts)label(defaults to the target key)publishcommand — computes registry/repo context per package and stamps label + URL into release metadatastatus/ci planJSON output —publishTargetsnow includelabel+registryTests
Added coverage for
buildPublishUrl(GHP, default, custom-registry, missing-repo cases),isGitHubPackagesRegistry,publishTargetLabel,resolvePackageRegistry,parseRepoSlug, and label rendering informatPublishedToSection. Full suite passes (327 tests); lint, format, and typecheck clean.