This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 866883ad6464 chore(ci): comment just once
866883ad6464 is described below

commit 866883ad6464f7d801efe406ac7c6d9e928df736
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Thu Feb 19 10:07:01 2026 +0100

    chore(ci): comment just once
---
 .github/workflows/pr-commenter.yml | 44 +++++++++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 13 deletions(-)

diff --git a/.github/workflows/pr-commenter.yml 
b/.github/workflows/pr-commenter.yml
index a4e7f493ed12..ad9c9a4362a0 100644
--- a/.github/workflows/pr-commenter.yml
+++ b/.github/workflows/pr-commenter.yml
@@ -68,18 +68,36 @@ jobs:
         with:
           github-token: ${{ secrets.GITHUB_TOKEN }}
           script: |
-            await github.rest.issues.createComment({
+            const prNumber = ${{ steps.pr.outputs.id }};
+      
+            // Get existing comments
+            const { data: comments } = await github.rest.issues.listComments({
               owner: context.repo.owner,
               repo: context.repo.repo,
-              issue_number: ${{ steps.pr.outputs.id }},
-              body: `:star2: Thank you for your contribution to the Apache 
Camel project! :star2:
-            :robot: CI automation will test this PR automatically.
-
-            :camel: Apache Camel Committers, please review the following items:
-
-            * First-time contributors **require MANUAL approval** for the 
GitHub Actions to run
-            * You can use the command \`/component-test 
(camel-)component-name1 (camel-)component-name2..\` to request a test from the 
test bot.
-            * You can label PRs using \`build-all\`, \`build-dependents\`, 
\`skip-tests\` and \`test-dependents\` to fine-tune the checks executed by this 
PR.
-            * Build and test logs are available in the Summary page. **Only** 
[Apache Camel committers](https://camel.apache.org/community/team/#committers) 
have access to the summary.
-            * :warning: Be careful when sharing logs. Review their contents 
before sharing them publicly.`
-            })
+              issue_number: prNumber,
+            });
+      
+            // Check if the bot already posted this specific message
+            const botCommentExists = comments.some(comment =>
+              comment.user.type === "Bot" &&
+              comment.body.includes("Thank you for your contribution to the 
Apache Camel project!")
+            );
+      
+            if (!botCommentExists) {
+              await github.rest.issues.createComment({
+                owner: context.repo.owner,
+                repo: context.repo.repo,
+                issue_number: prNumber,
+                body: `:star2: Thank you for your contribution to the Apache 
Camel project! :star2:
+              :robot: CI automation will test this PR automatically.
+  
+              :camel: Apache Camel Committers, please review the following 
items:
+  
+              * First-time contributors **require MANUAL approval** for the 
GitHub Actions to run
+              * You can use the command \`/component-test 
(camel-)component-name1 (camel-)component-name2..\` to request a test from the 
test bot although they are normally detected and executed by CI.
+              * You can label PRs using \`build-all\`, \`build-dependents\`, 
\`skip-tests\` and \`test-dependents\` to fine-tune the checks executed by this 
PR.
+              * Build and test logs are available in the summary page. 
**Only** [Apache Camel 
committers](https://camel.apache.org/community/team/#committers) have access to 
the summary.
+              
+              :warning: Be careful when sharing logs. Review their contents 
before sharing them publicly.`
+              })
+            }

Reply via email to