Fix npm OIDC trusted publishing: trailing slash in publishConfig.registry - #17
Conversation
…release/npm OIDC auth Co-authored-by: andrew-welker <1765622+andrew-welker@users.noreply.github.com>
…, remove registry-url Co-authored-by: andrew-welker <1765622+andrew-welker@users.noreply.github.com>
|
@copilot add an empty commit with a valid conventional commit message. Also, add instructions in this repo so that agents ALWAYS use conventional commit syntax. |
Co-authored-by: andrew-welker <1765622+andrew-welker@users.noreply.github.com>
Co-authored-by: andrew-welker <1765622+andrew-welker@users.noreply.github.com>
Done in commits The |
|
@copilot based on the releaserc.json, and standard conventional commit syntax, chore: won't trigger a version increment. Use fix, or feat. |
Co-authored-by: andrew-welker <1765622+andrew-welker@users.noreply.github.com>
Amended to |
@semantic-release/npm@13.1.5uses strict equality to gate the OIDC path:OFFICIAL_REGISTRY === registry, whereOFFICIAL_REGISTRY = "https://registry.npmjs.org/"(trailing slash). WithpublishConfig.registryset to"https://registry.npmjs.org"(no trailing slash), this check was alwaysfalse— OIDC was silently bypassed, falling through to token auth which also failed.The Trusted Publisher was correctly configured on npmjs.org; the mismatch was entirely on the client side.
Changes
package.json— Add trailing slash topublishConfig.registryso it matchesOFFICIAL_REGISTRYexactly, allowingoidcContextEstablished()to proceed to the OIDC token exchangebuild.yaml— Revertregistry-urlonsetup-node(re-added by a previous fix attempt); it is not needed and actively harmful — it writes a.npmrcauth token entry that causes@semantic-release/npmto skip OIDC and attemptnpm whoamiwith an unsetNODE_AUTH_TOKEN