fix(core): Updated dependencies and improved npm preparation logic.

This commit is contained in:
2024-11-05 02:38:21 +01:00
parent 66d28e5081
commit c6918399bf
6 changed files with 863 additions and 182 deletions

View File

@@ -52,12 +52,17 @@ export class NpmciNpmManager {
* authenticates npm with token from env var
*/
public async prepare() {
logger.log('info', 'running >>npm prepare<<');
const config = this.npmciRef.npmciConfig.getConfig();
let npmrcFileString: string = '';
await plugins.smartobject.forEachMinimatch(
process.env,
'NPMCI_TOKEN_NPM*',
(npmEnvArg: string) => {
if (!npmEnvArg) {
logger.log('note','found empty token...');
return;
}
const npmRegistryUrl = npmEnvArg.split('|')[0];
logger.log('ok', `found token for ${npmRegistryUrl}`);
let npmToken = npmEnvArg.split('|')[1];