mirror of
https://github.com/actions/setup-node
synced 2025-04-19 22:53:12 +00:00
add node auth token env
This commit is contained in:
parent
a4964cf370
commit
f5faff30bb
12
dist/index.js
vendored
12
dist/index.js
vendored
@ -4758,7 +4758,8 @@ function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let nodeAuthToken = '${NODE_AUTH_TOKEN}';
|
let defaultNodeAuthToken = '${NODE_AUTH_TOKEN}';
|
||||||
|
let nodeAuthToken = defaultNodeAuthToken;
|
||||||
// Check if auth url provided
|
// Check if auth url provided
|
||||||
const authUrl = core.getInput('auth-url');
|
const authUrl = core.getInput('auth-url');
|
||||||
if (authUrl) {
|
if (authUrl) {
|
||||||
@ -4784,8 +4785,13 @@ function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
|
|||||||
}
|
}
|
||||||
fs.writeFileSync(fileLocation, newContents);
|
fs.writeFileSync(fileLocation, newContents);
|
||||||
core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation);
|
core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation);
|
||||||
// Export empty node_auth_token so npm doesn't complain about not being able to find it
|
if (defaultNodeAuthToken !== nodeAuthToken) {
|
||||||
core.exportVariable('NODE_AUTH_TOKEN', 'XXXXX-XXXXX-XXXXX-XXXXX');
|
core.exportVariable('NODE_AUTH_TOKEN', nodeAuthToken);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Export empty node_auth_token so npm doesn't complain about not being able to find it
|
||||||
|
core.exportVariable('NODE_AUTH_TOKEN', 'XXXXX-XXXXX-XXXXX-XXXXX');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//# sourceMappingURL=authutil.js.map
|
//# sourceMappingURL=authutil.js.map
|
||||||
|
@ -76,7 +76,8 @@ async function writeRegistryToFile(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
let nodeAuthToken = '${NODE_AUTH_TOKEN}';
|
let defaultNodeAuthToken = '${NODE_AUTH_TOKEN}';
|
||||||
|
let nodeAuthToken = defaultNodeAuthToken;
|
||||||
// Check if auth url provided
|
// Check if auth url provided
|
||||||
const authUrl: string = core.getInput('auth-url');
|
const authUrl: string = core.getInput('auth-url');
|
||||||
if (authUrl) {
|
if (authUrl) {
|
||||||
@ -108,6 +109,10 @@ async function writeRegistryToFile(
|
|||||||
|
|
||||||
fs.writeFileSync(fileLocation, newContents);
|
fs.writeFileSync(fileLocation, newContents);
|
||||||
core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation);
|
core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation);
|
||||||
// Export empty node_auth_token so npm doesn't complain about not being able to find it
|
if (defaultNodeAuthToken !== nodeAuthToken) {
|
||||||
core.exportVariable('NODE_AUTH_TOKEN', 'XXXXX-XXXXX-XXXXX-XXXXX');
|
core.exportVariable('NODE_AUTH_TOKEN', nodeAuthToken)
|
||||||
|
} else {
|
||||||
|
// Export empty node_auth_token so npm doesn't complain about not being able to find it
|
||||||
|
core.exportVariable('NODE_AUTH_TOKEN', 'XXXXX-XXXXX-XXXXX-XXXXX');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user