diff --git a/lib/authutil.js b/lib/authutil.js index d428b4e..b9fe8cb 100644 --- a/lib/authutil.js +++ b/lib/authutil.js @@ -30,15 +30,7 @@ function writeRegistryToFile(registryUrl, fileLocation) { } core.debug(`Setting auth in ${fileLocation}`); let newContents = ''; - if (fs.existsSync(fileLocation)) { - const curContents = fs.readFileSync(fileLocation, 'utf8'); - curContents.split(os.EOL).forEach((line) => { - // Add current contents unless they are setting the registry - if (!line.toLowerCase().startsWith('registry')) { - newContents += line + os.EOL; - } - }); - } + // Remove http: or https: from front of registry. const authString = registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}'; const registryString = scope