From 45d9f13abf905029cef8803b64f2a853616f4333 Mon Sep 17 00:00:00 2001 From: Matt Travi Date: Wed, 8 Jun 2022 21:09:47 -0500 Subject: [PATCH] fix(log-repo): use the original form of the repo url to remove the need to mask credentials (#2459) fixes #2449 --- index.js | 3 ++- test/index.test.js | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5031414797..b7ca2e74d8 100644 --- a/index.js +++ b/index.js @@ -86,7 +86,7 @@ async function run(context, plugins) { } logger[options.dryRun ? 'warn' : 'success']( - `Run automated release from branch ${ciBranch} on repository ${options.repositoryUrl}${ + `Run automated release from branch ${ciBranch} on repository ${options.originalRepositoryURL}${ options.dryRun ? ' in dry-run mode' : '' }` ); @@ -293,6 +293,7 @@ module.exports = async (cliOptions = {}, {cwd = process.cwd(), env = process.env context.logger.log(`Running ${pkg.name} version ${pkg.version}`); try { const {plugins, options} = await getConfig(context, cliOptions); + options.originalRepositoryURL = options.repositoryUrl; context.options = options; try { const result = await run(context, plugins); diff --git a/test/index.test.js b/test/index.test.js index cf8dc8bba8..e59dc02183 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -91,6 +91,7 @@ test('Plugins are called with expected values', async (t) => { const config = { branches: [{name: 'master'}, {name: 'next'}], repositoryUrl, + originalRepositoryURL: repositoryUrl, globalOpt: 'global', tagFormat: `v\${version}`, allowOutdatedBranch: false, @@ -933,7 +934,13 @@ test('Log all "verifyConditions" errors', async (t) => { const error2 = new SemanticReleaseError('error 2', 'ERR2'); const error3 = new SemanticReleaseError('error 3', 'ERR3'); const fail = stub().resolves(); - const config = {branches: [{name: 'master'}], repositoryUrl, tagFormat: `v\${version}`, allowOutdatedBranch: false}; + const config = { + branches: [{name: 'master'}], + repositoryUrl, + originalRepositoryURL: repositoryUrl, + tagFormat: `v\${version}`, + allowOutdatedBranch: false, + }; const options = { ...config, plugins: false,