You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2023/05/30 20:39:24 UTC

[camel] branch main updated: Add comment result to the component-test action part 2 (#10247)

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

nfilotto 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 8ed821853d0 Add comment result to the component-test action part 2 (#10247)
8ed821853d0 is described below

commit 8ed821853d0fe56360f154f01c4f4e9eda3f259b
Author: Nicolas Filotto <es...@users.noreply.github.com>
AuthorDate: Tue May 30 22:39:18 2023 +0200

    Add comment result to the component-test action part 2 (#10247)
---
 .github/workflows/pr-comment-main.yml | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/pr-comment-main.yml b/.github/workflows/pr-comment-main.yml
index ba2b31d2bf7..9f3f2bf2d4b 100644
--- a/.github/workflows/pr-comment-main.yml
+++ b/.github/workflows/pr-comment-main.yml
@@ -53,19 +53,27 @@ jobs:
           comment-body: ${{ github.event.comment.body }}
       - name: Success comment
         if: success()
-        uses: peter-evans/create-or-update-comment@v3.0.1
+        uses: actions/github-script@v6
         with:
-          comment-id: ${{ github.event.comment.id }}
-          body: |
-            ${{ github.event.comment.body }}
-            The tests passed successfully
-          reactions: hooray
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          script: |
+            await github.rest.issues.updateComment({
+                  owner: context.repo.owner,
+                  repo: context.repo.repo,
+                  issue_number: context.issue.number,
+                  comment_id: ${{ github.event.comment.id }},
+                  body: "${{ github.event.comment.body }}\n :hooray: The tests passed successfully"
+            });
       - name: Failure comment
         if: failure()
-        uses: peter-evans/create-or-update-comment@v3.0.1
+        uses: actions/github-script@v6
         with:
-          comment-id: ${{ github.event.comment.id }}
-          body: |
-            ${{ github.event.comment.body }}
-            The tests failed
-          reactions: confused
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          script: |
+            await github.rest.issues.updateComment({
+                  owner: context.repo.owner,
+                  repo: context.repo.repo,
+                  issue_number: context.issue.number,
+                  comment_id: ${{ github.event.comment.id }},
+                  body: "${{ github.event.comment.body }}\n :confused: The tests failed please check the logs"
+            });