mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2026-03-21 06:55:55 +03:00
Merge ecb118ff9d into 53b83947a5
This commit is contained in:
commit
35a1b1e379
4 changed files with 31 additions and 7 deletions
8
dist/setup/index.js
vendored
8
dist/setup/index.js
vendored
|
|
@ -81105,8 +81105,12 @@ function writeRegistryToFile(registryUrl, fileLocation) {
|
|||
newContents += `${authString}${os.EOL}${registryString}`;
|
||||
fs.writeFileSync(fileLocation, newContents);
|
||||
core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation);
|
||||
// Export empty node_auth_token if didn't exist so npm doesn't complain about not being able to find it
|
||||
core.exportVariable('NODE_AUTH_TOKEN', process.env.NODE_AUTH_TOKEN || 'XXXXX-XXXXX-XXXXX-XXXXX');
|
||||
// Only export NODE_AUTH_TOKEN if explicitly provided by user
|
||||
// This is required to support NPM OIDC tokens which need NODE_AUTH_TOKEN to be unset
|
||||
// See: https://github.com/actions/setup-node/issues/1440
|
||||
if (Object.prototype.hasOwnProperty.call(process.env, 'NODE_AUTH_TOKEN')) {
|
||||
core.exportVariable('NODE_AUTH_TOKEN', process.env.NODE_AUTH_TOKEN);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue