Skip to content

Commit

Permalink
fix(.npmrc): clean up .npmrc file in the repo after releasing
Browse files Browse the repository at this point in the history
Issue: "Failed to replace env in config: ${NPM_TOKEN}" after release #2
solution:semantic-release/semantic-release#974 (comment)
  • Loading branch information
cycjimmy committed Oct 26, 2019
1 parent 602ea31 commit a0ef86e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/index.js
Expand Up @@ -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;
Expand Down

0 comments on commit a0ef86e

Please sign in to comment.