mirror of
https://github.com/actions/setup-node.git
synced 2026-06-08 13:33:47 +08:00
Merge ecb118ff9d into 53b83947a5
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user