@@ -13,11 +13,10 @@ const path = __importStar(require("path"));
1313const core = __importStar ( require ( "@actions/core" ) ) ;
1414const github = __importStar ( require ( "@actions/github" ) ) ;
1515function configAuthentication ( registryUrl ) {
16- // const npmrc: string = path.resolve(
17- // process.env['RUNNER_TEMP'] || process.cwd(),
18- // '.npmrc'
19- // );
20- const npmrc = path . resolve ( process . cwd ( ) , '.npmrc' ) ;
16+ const npmrc = path . resolve ( process . env [ 'RUNNER_TEMP' ] || process . cwd ( ) , '.npmrc' ) ;
17+ if ( ! registryUrl . endsWith ( '/' ) ) {
18+ registryUrl += '/' ;
19+ }
2120 writeRegistryToFile ( registryUrl , npmrc ) ;
2221}
2322exports . configAuthentication = configAuthentication ;
@@ -47,7 +46,7 @@ function writeRegistryToFile(registryUrl, fileLocation) {
4746 : `registry=${ registryUrl } ` ;
4847 newContents += `${ authString } ${ os . EOL } ${ registryString } ` ;
4948 fs . writeFileSync ( fileLocation , newContents ) ;
50- // core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation);
49+ core . exportVariable ( 'NPM_CONFIG_USERCONFIG' , fileLocation ) ;
5150 // Export empty node_auth_token so npm doesn't complain about not being able to find it
52- // core.exportVariable('NODE_AUTH_TOKEN', 'XXXXX-XXXXX-XXXXX-XXXXX');
51+ core . exportVariable ( 'NODE_AUTH_TOKEN' , 'XXXXX-XXXXX-XXXXX-XXXXX' ) ;
5352}
0 commit comments