Trusted Publisher OIDC fails with "package not found" for packages in monorepo subdirectories (nested workspace packages) #202661
Unanswered
CarlosEduJs
asked this question in
npm
Replies: 1 comment
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
Body
Summary
npm publishwith OIDC Trusted Publishing fails with errorENEEDAUTH/ E404.The failure occurs for a package located in a subdirectory of a monorepo (
packages/ikihsjs). The Trusted Publisher configuration is correct and verified.Environment
npm publishpackages/ikihsjspackage.json (relevant fields)
Trusted Publisher Configuration (npmjs.com)
carlosedujs/ikihspublish.ymlnpm publish✅Workflow Permissions
Verification Steps Performed
Trusted Publisher config
I deliberately added a typo (capital letter) in the repository configuration as a test. This produced a different, config-mismatch error. After I corrected the typo, the original “package not found” error returned. This confirms that the OIDC validation passes and the failure happens after this step.
npm version
I ran
npm install -g npm@latestbefore publish. The error remained.Registry and authentication
The registry URL is set correctly via
actions/setup-node.NODE_AUTH_TOKENis intentionally unset (no legacy token).Workspace command
I tried
npm publish --workspace packages/ikihsjsfrom the repository root. The same failure occurred.Verbose Log (relevant lines)
Important Note
The GitHub Actions ID Token request succeeds (status 200). The Provenance Statement is signed and published successfully to the Sigstore transparency log. The failure occurs only on the npm token exchange endpoint (
/-/npm/v1/oidc/token/exchange/package/{name}), which returns 404 “package not found”.Suspected Root Cause
The issue is likely related to how npm resolves the package during the OIDC token exchange when the package uses
repository.directory(subdirectory in a monorepo). This matches the pattern reported in npm/cli#8730 and npm/cli#8678.Related Issues
I can provide the full debug log or a minimal reproduction repository if needed.
All reactions