Skip to content

fix: label & link GitHub Packages releases correctly (#123)#124

Merged
theoephraim merged 1 commit into
mainfrom
fix/github-packages-release-url
Jun 18, 2026
Merged

fix: label & link GitHub Packages releases correctly (#123)#124
theoephraim merged 1 commit into
mainfrom
fix/github-packages-release-url

Conversation

@theoephraim

@theoephraim theoephraim commented Jun 18, 2026

Copy link
Copy Markdown
Member

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 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.

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
@github-actions

Copy link
Copy Markdown

bumpy-frog

The changes in this PR will be included in the next version bump.

patch Patch releases

  • @varlock/bumpy 1.14.0 → 1.14.1

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@theoephraim theoephraim merged commit 74a8aa6 into main Jun 18, 2026
5 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.

GitHub Packages publishes mislabelled "npm" with dead npmjs.com link

1 participant