Skip to content

Commit cba09e2

Browse files
committed
Explain how release works in GitHub workflows without an npm token
1 parent 8b8a91e commit cba09e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/release-package.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ if (!GH_TOKEN) {
157157
process.exit(1);
158158
}
159159

160+
// An NPM token is needed to run the script from a local machine.
161+
// Authentication from a GitHub workflow rather relies on OpenID Connect
162+
// and the release workflow must be added as a trusted publisher for each
163+
// npm package that can be released, see:
164+
// https://docs.npmjs.com/trusted-publishers
160165
const NPM_TOKEN = config?.NPM_TOKEN ?? process.env.NPM_TOKEN;
161166

162167
// Note: npm-publish has a bug and needs an "INPUT_TOKEN" env variable:

0 commit comments

Comments
 (0)