From 2c159457d3c85f0af0024a29e9c6e9508261a487 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Wed, 4 Feb 2026 14:14:13 +0100 Subject: [PATCH 1/2] Update existing comment if no issues found --- src/main.ts | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index 3b746e5..df3d90e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -212,12 +212,6 @@ async function run(): Promise { scanForReplacements(messages, baseDependencies, currentDependencies); } - // Skip comment creation/update if there are no messages - if (messages.length === 0) { - core.info('No dependency warnings found. Skipping comment creation.'); - return; - } - const octokit = github.getOctokit(token); let existingCommentId: number | undefined = undefined; @@ -244,6 +238,24 @@ async function run(): Promise { } } + // Skip comment creation if there are no messages or update the existing comment. + if (messages.length === 0) { + if (existingCommentId) { + await octokit.rest.issues.updateComment({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + comment_id: existingCommentId, + body: `${COMMENT_TAG}\n## e18e dependency diff action\n\nNo dependency warnings found.\n` + }); + core.info( + `Updated existing dependency diff comment #${existingCommentId}` + ); + } else { + core.info('No dependency warnings found. Skipping comment creation.'); + } + return; + } + const finalCommentBody = `${COMMENT_TAG}\n${messages.join('\n\n')}`; if (existingCommentId) { From aa3c3c30ab374d4ef7bf910c5d6b1a54cbffe908 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Wed, 4 Feb 2026 16:24:33 +0100 Subject: [PATCH 2/2] =?UTF-8?q?analysis!=20=F0=9F=A7=91=E2=80=8D?= =?UTF-8?q?=F0=9F=94=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: James Garbutt <43081j@users.noreply.github.com> --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index df3d90e..fcaa252 100644 --- a/src/main.ts +++ b/src/main.ts @@ -245,7 +245,7 @@ async function run(): Promise { owner: github.context.repo.owner, repo: github.context.repo.repo, comment_id: existingCommentId, - body: `${COMMENT_TAG}\n## e18e dependency diff action\n\nNo dependency warnings found.\n` + body: `${COMMENT_TAG}\n## e18e dependency analysis\n\nNo dependency warnings found.\n` }); core.info( `Updated existing dependency diff comment #${existingCommentId}`