Skip to content

Commit

Permalink
added silent flag to npm version script, to avoid unwanted npm output (
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvalshilo authored Jun 26, 2024
1 parent 4787de1 commit afdd561
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ const pkg = getPackageJson();
// important for further usage of the package.json version
await runInWorkspace('npm', ['version', '--allow-same-version=true', '--git-tag-version=false', current]);
console.log('current 1:', current, '/', 'version:', version);
let newVersion = parseNpmVersionOutput(execSync(`npm version --git-tag-version=false ${version}`).toString());
let newVersion = parseNpmVersionOutput(execSync(`npm version --git-tag-version=false ${version} --silent`).toString());
console.log('newVersion 1:', newVersion);
newVersion = `${tagPrefix}${newVersion}${tagSuffix}`;
if (process.env['INPUT_SKIP-COMMIT'] !== 'true') {
Expand All @@ -221,7 +221,7 @@ const pkg = getPackageJson();
await runInWorkspace('npm', ['version', '--allow-same-version=true', '--git-tag-version=false', current]);
console.log('current 2:', current, '/', 'version:', version);
console.log('execute npm version now with the new version:', version);
newVersion = parseNpmVersionOutput(execSync(`npm version --git-tag-version=false ${version}`).toString());
newVersion = parseNpmVersionOutput(execSync(`npm version --git-tag-version=false ${version} --silent`).toString());
// fix #166 - npm workspaces
// https://github.com/phips28/gh-action-bump-version/issues/166#issuecomment-1142640018
newVersion = newVersion.split(/\n/)[1] || newVersion;
Expand Down

0 comments on commit afdd561

Please sign in to comment.