This repository was archived by the owner on Sep 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ const path = require('path');
29
29
const runCommand = require ( './run-command' ) ;
30
30
31
31
const packagesDirPath = path . resolve ( __dirname , '../packages' ) ;
32
- const npmrcPath = path . resolve ( process . env . HOME , '.npmrc' ) ;
32
+ const npmrcPath = process . env . NPM_CONFIG_USERCONFIG ;
33
33
34
34
async function isPackageVersionPublished ( packageName , version ) {
35
35
return fetch ( `https://registry.npmjs.org/${ encodeURI ( packageName ) } /${ version } ` )
@@ -56,10 +56,11 @@ async function getPackageInfo(packageDir) {
56
56
57
57
async function setupNpm ( ) {
58
58
// For npm publication to work, the NPM token must be stored in the .npmrc file
59
+ console . log ( 'Current .npmrc file:\n' , await fs . readFile ( npmrcPath , 'utf8' ) ) ;
59
60
if ( process . env . GITHUB_ACTIONS && process . env . NPM_TOKEN ) {
60
- await fs . writeFile (
61
+ await fs . appendFile (
61
62
npmrcPath ,
62
- `//registry.npmjs.org/:_authToken=${ process . env . NPM_TOKEN } \nregistry=https://registry.npmjs.org/ ` ,
63
+ `\n //registry.npmjs.org/:_authToken=${ process . env . NPM_TOKEN } ` ,
63
64
'utf8' ) ;
64
65
}
65
66
}
You can’t perform that action at this time.
0 commit comments