This commit is contained in:
Satishchoudhary94 2026-03-04 14:20:33 +04:00 committed by GitHub
commit 35a1b1e379
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 7 deletions

8
dist/setup/index.js vendored
View file

@ -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);
}
}