diff --git a/lib/success.js b/lib/success.js index 48246f29..5a92c818 100644 --- a/lib/success.js +++ b/lib/success.js @@ -62,9 +62,11 @@ export default async function success(pluginConfig, context, { Octokit }) { logger.log("No commits found in release"); } logger.log("Skip commenting on issues and pull requests."); - logger.warn( - `DEPRECATION: 'false' for 'successComment' is deprecated and will be removed in a future major version. Use 'successCommentCondition' instead.`, - ); + if (successComment === false) { + logger.warn( + `DEPRECATION: 'false' for 'successComment' is deprecated and will be removed in a future major version. Use 'successCommentCondition' instead.`, + ); + } } else if (successCommentCondition === false) { logger.log("Skip commenting on issues and pull requests."); } else { diff --git a/test/success.test.js b/test/success.test.js index e88e1b70..90f465ec 100644 --- a/test/success.test.js +++ b/test/success.test.js @@ -1440,6 +1440,7 @@ test("Do not add comment and labels if no commits is found for release", async ( t.true( t.context.log.calledWith("Skip commenting on issues and pull requests."), ); + t.false(t.context.warn.called); }); test("Do not add comment and labels to PR/issues from other repo", async (t) => { @@ -3269,6 +3270,11 @@ test('Skip comment on on issues/PR if "successComment" is "false"', async (t) => t.true( t.context.log.calledWith("Skip commenting on issues and pull requests."), ); + t.true( + t.context.warn.calledWith( + "DEPRECATION: 'false' for 'successComment' is deprecated and will be removed in a future major version. Use 'successCommentCondition' instead.", + ), + ); t.true(fetch.done()); });