Skip to content

Commit 52d8b1b

Browse files
authored
docs: Additional troubleshooting tips for trusted publishing (#1925)
Based on the community conversation in npm/cli#8730 and the specific difficulties detailed in npm/cli#8730 (comment)
1 parent 47f2889 commit 52d8b1b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

content/packages-and-modules/securing-your-code/trusted-publishers.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,13 @@ If you encounter an "Unable to authenticate" (ENEEDAUTH) error when publishing,
332332

333333
</Note>
334334

335+
To publish from GitHub, your package's `repository.url` field in `package.json` must exactly match your GitHub repository. This may be an issue for misconfigured packages, but could also impact publication from forks that haven't updated `package.json` to match the forked repo.
336+
335337
If your package has private dependencies and `npm install` or `npm ci` is failing with authentication errors, remember that trusted publishing only applies to the `npm publish` command. You'll still need to provide a read-only token for installing private packages as shown in the examples above.
336338

337339
For packages in private repositories, provenance will not be generated even though you're using trusted publishing. This is a [known limitation](https://github.blog/changelog/2023-07-25-publishing-with-npm-provenance-from-private-source-repositories-is-no-longer-supported/) that applies regardless of whether your package itself is public or private.
338340

339-
Some GitHub Actions workflows use `workflow_call` to invoke other workflows that run `npm publish`, or use `workflow_dispatch` for manual publishing. When this happens, validation checks the calling workflow's name instead of the workflow that actually contains the publish command, which can cause configuration mismatches.
341+
Some GitHub Actions workflows use `workflow_call` to invoke other workflows that run `npm publish`, or use `workflow_dispatch` for manual publishing. When this happens, validation checks the calling workflow's name instead of the workflow that actually contains the publish command, which can cause configuration mismatches. The `id-token: write` permission must also be given to both parent and child workflows.
340342

341343
## Limitations and future improvements
342344

0 commit comments

Comments
 (0)