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:38:53 UTC

[camel] 01/01: Add comment result to the component-test action part 2

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

nfilotto pushed a commit to branch component-tests-v3
in repository https://gitbox.apache.org/repos/asf/camel.git

commit dda69d4e36a3a8089143d6ed5258769e0e38b3e0
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Tue May 30 22:38:24 2023 +0200

    Add comment result to the component-test action part 2
---
 .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"
+            });