From c1aeac74aac7d6b48524756ba9d8426bd2f29fb8 Mon Sep 17 00:00:00 2001 From: prosdev Date: Tue, 14 Jul 2026 21:41:43 -0700 Subject: [PATCH] fix(release): pin npmjs.org registry in publishConfig so changeset detection works MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the pnpm 10 fix unblocked OIDC publishing, the Release job still exits non-zero: `changeset publish` reports both @prosdevlab/dev-agent and @prosdevlab/kero as "has not been published on npm" and tries to publish them, then npm rejects the already-published versions ("cannot publish over the previously published versions"). Root cause: changesets' pre-publish check runs `npm info ` whose registry comes from getCorrectRegistry() — which resolves the scoped registry from `publishConfig["@prosdevlab:registry"]` OR the ambient `npm_config_@prosdevlab:registry` env var. In CI that env var points the @prosdevlab scope at GitHub Packages, where these packages don't exist, so `npm info` 404s and changesets assumes they're unpublished. Meanwhile OIDC trusted publishing forces the actual publish to npmjs.org, which then correctly refuses the existing versions. Net: every no-op release is red. Fix: set the scoped registry in each published package's publishConfig. getCorrectRegistry reads publishConfig before the env var (`?.[] || env`), so this deterministically points `npm info` (and publish) at npmjs.org — changesets sees the real published versions and skips them. Verified by simulating getCorrectRegistry against the installed @changesets/cli source: with the GitHub-Packages env var set, publishConfig still resolves to https://registry.npmjs.org/. Registry URLs only; no secrets. publishConfig applies at publish time and does not affect package consumers. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/dev-agent/package.json | 4 +++- packages/logger/package.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/dev-agent/package.json b/packages/dev-agent/package.json index 3408a58..7722c67 100644 --- a/packages/dev-agent/package.json +++ b/packages/dev-agent/package.json @@ -58,6 +58,8 @@ "node": ">=22.0.0" }, "publishConfig": { - "access": "public" + "access": "public", + "registry": "https://registry.npmjs.org/", + "@prosdevlab:registry": "https://registry.npmjs.org/" } } diff --git a/packages/logger/package.json b/packages/logger/package.json index 83e1858..43dab6a 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -57,7 +57,9 @@ "node": ">=22" }, "publishConfig": { - "access": "public" + "access": "public", + "registry": "https://registry.npmjs.org/", + "@prosdevlab:registry": "https://registry.npmjs.org/" }, "devDependencies": { "@types/node": "^24.10.1",