From cacc0d8994471bad4ba05cb5fdbc8416207de5cf Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sun, 29 Jun 2025 22:45:41 +0200 Subject: [PATCH] Update PR-Demo-cleanup.yml --- .github/workflows/PR-Demo-cleanup.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/PR-Demo-cleanup.yml b/.github/workflows/PR-Demo-cleanup.yml index 7aa1e9586..2a6d37f52 100644 --- a/.github/workflows/PR-Demo-cleanup.yml +++ b/.github/workflows/PR-Demo-cleanup.yml @@ -75,20 +75,22 @@ jobs: issue_number: prNumber }); - const deploymentComment = comments.data.find(c => + const deploymentComments = comments.data.filter(c => c.body?.includes("## 🚀 PR Test Deployment") && c.user?.type === "Bot" ); - if (deploymentComment) { - await github.rest.issues.deleteComment({ - owner, - repo, - comment_id: deploymentComment.id - }); - console.log(`Deleted deployment comment (ID: ${deploymentComment.id})`); + if (deploymentComments.length > 0) { + for (const comment of deploymentComments) { + await github.rest.issues.deleteComment({ + owner, + repo, + comment_id: comment.id + }); + console.log(`Deleted deployment comment (ID: ${comment.id})`); + } } else { - console.log("No matching deployment comment found."); + console.log("No matching deployment comments found."); } core.setOutput('present', hasLabel || deploymentComment ? 'true' : 'false');