This problem was found testing out the beta release for OIDC trusted publishing (now officially released) and there's some more context in that issue.
When set up to use the new OIDC trusted publishing with npm, the first release on a maintenance branch (ex. 1.32.x) fails with the following error:
[semantic-release] [@semantic-release/npm] › ℹ Adding version 1.32.0 to npm registry on dist-tag release-1.32.x
npm error code E401
npm error 401 Unauthorized - PUT https://registry.npmjs.org/-/package/<package>/dist-tags/release-1.32.x
Steps to reproduce:
- Create a fresh patch maintenance branch (like
1.32.x)
- Merge a
fix: commit to that branch
- Get to the
Start step "addChannel" of plugin "@semantic-release/npm" step of the release workflow
- Get the error above
- Merge another commit to that branch, and get a successful release and publish
@travi already confirmed seeing the same behavior.
Opening the issue here, but it sounds like this is likely an npm issue.