From a0ef86eea3257234992126447d883529ce057ece Mon Sep 17 00:00:00 2001 From: cycjimmy Date: Sat, 26 Oct 2019 15:51:03 +0800 Subject: [PATCH] fix(.npmrc): clean up `.npmrc` file in the repo after releasing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: "Failed to replace env in config: ${NPM_TOKEN}" after release #2 solution:https://github.com/semantic-release/semantic-release/issues/974#issuecomment-546577677 --- src/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/index.js b/src/index.js index 83184aba..ec963bcf 100644 --- a/src/index.js +++ b/src/index.js @@ -60,6 +60,17 @@ const release = async () => { ...(handleDryRunOption()), }); + // Clean up `.npmrc` file in the repo after releasing + { + const {stdout, stderr} = await exec(`rm -f .npmrc`, { + cwd: path.resolve(__dirname) + }); + core.debug(stdout); + if (stderr) { + core.debug(stderr); + } + } + if (!result) { core.debug('No release published.'); return;