mirror of
				https://github.com/actions/setup-node.git
				synced 2025-10-26 07:16:44 +08:00 
			
		
		
		
	Add single quotes for authString
This commit is contained in:
		
							parent
							
								
									e7609c8e84
								
							
						
					
					
						commit
						c970c05a19
					
				| @ -36,13 +36,13 @@ function writeRegistryToFile(registryUrl: string, fileLocation: string) { | |||||||
|   } |   } | ||||||
|   // Remove http: or https: from front of registry.
 |   // Remove http: or https: from front of registry.
 | ||||||
|   const authString = |   const authString = | ||||||
|     registryUrl.replace(/(^\w+:|^)/, '') + `:_authToken=${NODE_AUTH_TOKEN}`; |     registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}'; | ||||||
|   const registryString = scope |   const registryString = scope | ||||||
|     ? `${scope}:registry=${registryUrl}` |     ? `${scope}:registry=${registryUrl}` | ||||||
|     : `registry=${registryUrl}`; |     : `registry=${registryUrl}`; | ||||||
|   newContents += `${registryString}${os.EOL}${authString}`; |   newContents += `${registryString}${os.EOL}${authString}`; | ||||||
|   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
 |   // 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');
 |   // core.exportVariable('NODE_AUTH_TOKEN', 'XXXXX-XXXXX-XXXXX-XXXXX');
 | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user