From 26d01b818fd77fb6b2563c57426d99d3e1721699 Mon Sep 17 00:00:00 2001 From: wyhlyh913 <3496036225@qq.com> Date: Fri, 6 Nov 2026 08:49:46 +0800 Subject: [PATCH] fix: correct successComment deprecation warning --- lib/success.js | 9 ++++++--- test/success.test.js | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/success.js b/lib/success.js index 48246f29..282f015d 100644 --- a/lib/success.js +++ b/lib/success.js @@ -62,9 +62,12 @@ 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..2f9602bc 100644 --- a/test/success.test.js +++ b/test/success.test.js @@ -1440,6 +1440,11 @@ 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.calledWith( + "DEPRECATION: 'false' for 'successComment' is deprecated and will be removed in a future major version. Use 'successCommentCondition' instead.", + ), + ); }); test("Do not add comment and labels to PR/issues from other repo", async (t) => {