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/11/02 11:31:01 UTC

(camel) branch camel-4.0.x updated (b0f910c6019 -> b02b9df6acd)

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

nfilotto pushed a change to branch camel-4.0.x
in repository https://gitbox.apache.org/repos/asf/camel.git


    from b0f910c6019 CAMEL-20039: camel-core - SimpleLRUCache add support for soft cache (#11881)
     new 1f9719e1961 (chore) ci: avoid token exposure in pr-comment workflow (#11880)
     new bfb6a8086c9 (chore) ci: use local create-or-update-comment in pr-comment workflow
     new 8a6e799887c (chore) ci: use github.event instead of context
     new 4bc4241ea31 (chore) ci: fix the pr comment update to provide the result
     new b02b9df6acd (chore) ci: replace comment on edit to provide the result

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/actions/component-test/action.yaml | 37 ++++++++++--------------------
 .github/workflows/pr-comment.yml           | 17 +++++---------
 2 files changed, 18 insertions(+), 36 deletions(-)


(camel) 02/05: (chore) ci: use local create-or-update-comment in pr-comment workflow

Posted by nf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bfb6a8086c944de0ddb62428af80363cc77b4df3
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Thu Nov 2 11:32:25 2023 +0100

    (chore) ci: use local create-or-update-comment in pr-comment workflow
---
 .github/workflows/pr-comment.yml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml
index baa3837190c..f63761b83f8 100644
--- a/.github/workflows/pr-comment.yml
+++ b/.github/workflows/pr-comment.yml
@@ -32,11 +32,6 @@ jobs:
       matrix:
         java: [ '17' ]
     steps:
-      - uses: peter-evans/create-or-update-comment@v3.1.0
-        with:
-          issue-number: ${{ context.issue.number }}
-          body: |
-            :robot: The Apache Camel test robot will run the tests for you :+1:
       - name: Retrieve sha
         uses: actions/github-script@v6
         with:
@@ -52,6 +47,11 @@ jobs:
         with:
           ref: ${{ env.pr_sha }}
           submodules: recursive
+      - uses: ./.github/actions/create-or-update-comment
+        with:
+          issue-number: ${{ context.issue.number }}
+          body: |
+            :robot: The Apache Camel test robot will run the tests for you :+1:
       - id: install-packages
         uses: ./.github/actions/install-packages
       - name: Set up JDK ${{ matrix.java }}


(camel) 01/05: (chore) ci: avoid token exposure in pr-comment workflow (#11880)

Posted by nf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1f9719e196147ed74d9b3e239550dcd3d67c03e4
Author: Nicolas Filotto <es...@users.noreply.github.com>
AuthorDate: Thu Nov 2 11:25:13 2023 +0100

    (chore) ci: avoid token exposure in pr-comment workflow (#11880)
    
    ## Motivation
    
    To avoid potential vulnerabilities due to exposure of the `GITHUB_TOKEN`, it is recommended to use the Github action [create-or-update-comment](https://github.com/peter-evans/create-or-update-comment)
    
    ## Modifications:
    
    * Use the local github action create-or-update-comment
---
 .github/actions/component-test/action.yaml | 35 +++++++++---------------------
 .github/workflows/pr-comment.yml           | 15 +++++--------
 2 files changed, 15 insertions(+), 35 deletions(-)

diff --git a/.github/actions/component-test/action.yaml b/.github/actions/component-test/action.yaml
index 0f63f351a30..f9266dbdb66 100644
--- a/.github/actions/component-test/action.yaml
+++ b/.github/actions/component-test/action.yaml
@@ -18,9 +18,6 @@
 name: "Component Test Runner"
 description: "Runs tests of corresponding to the given comment"
 inputs:
-  github-token:
-    description: 'GitHub token to use to update the comment'
-    required: true
   run-id:
     description: 'Id of the job'
     required: true
@@ -68,31 +65,19 @@ runs:
         path: tests.log
     - name: Success comment
       if: success()
-      uses: actions/github-script@v6
+      uses: ./.github/actions/create-or-update-comment
       with:
-        github-token: ${{ inputs.github-token }}
-        script: |
-          await github.rest.issues.updateComment({
-                owner: context.repo.owner,
-                repo: context.repo.repo,
-                issue_number: ${{ inputs.pr-id }},
-                comment_id: ${{ inputs.comment-id }},
-                body: `${{ inputs.comment-body }}
+        comment-id: ${{ inputs.comment-id }}
+        body: |
+          ${{ inputs.comment-body }}
 
-          **Result** :white_check_mark: The tests passed successfully`
-          });
+          **Result** :white_check_mark: The tests passed successfully
     - name: Failure comment
       if: failure()
-      uses: actions/github-script@v6
+      uses: ./.github/actions/create-or-update-comment
       with:
-        github-token: ${{ inputs.github-token }}
-        script: |
-          await github.rest.issues.updateComment({
-                owner: context.repo.owner,
-                repo: context.repo.repo,
-                issue_number: ${{ inputs.pr-id }},
-                comment_id: ${{ inputs.comment-id }},
-                body: `${{ inputs.comment-body }}
+        comment-id: ${{ inputs.comment-id }}
+        body: |
+          ${{ inputs.comment-body }}
 
-          **Result** :x: The tests failed please [check the logs](https://github.com/apache/camel/actions/runs/${{ inputs.run-id }})`
-          });
+          **Result** :x: The tests failed please [check the logs](https://github.com/apache/camel/actions/runs/${{ inputs.run-id }})
diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml
index 9463ab2d2e0..baa3837190c 100644
--- a/.github/workflows/pr-comment.yml
+++ b/.github/workflows/pr-comment.yml
@@ -32,16 +32,11 @@ jobs:
       matrix:
         java: [ '17' ]
     steps:
-      - uses: actions/github-script@v6
+      - uses: peter-evans/create-or-update-comment@v3.1.0
         with:
-          github-token: ${{ secrets.GITHUB_TOKEN }}
-          script: |
-            github.rest.issues.createComment({
-              issue_number: context.issue.number,
-              owner: context.repo.owner,
-              repo: context.repo.repo,
-              body: `:robot: The Apache Camel test robot will run the tests for you :+1:`
-            })
+          issue-number: ${{ context.issue.number }}
+          body: |
+            :robot: The Apache Camel test robot will run the tests for you :+1:
       - name: Retrieve sha
         uses: actions/github-script@v6
         with:
@@ -56,6 +51,7 @@ jobs:
       - uses: actions/checkout@v3
         with:
           ref: ${{ env.pr_sha }}
+          submodules: recursive
       - id: install-packages
         uses: ./.github/actions/install-packages
       - name: Set up JDK ${{ matrix.java }}
@@ -68,7 +64,6 @@ jobs:
         name: Component test execution
         uses: ./.github/actions/component-test
         with:
-          github-token: ${{ secrets.GITHUB_TOKEN }}
           run-id: ${{ github.run_id }}
           pr-id: ${{ github.event.issue.number }}
           comment-id: ${{ github.event.comment.id }}


(camel) 03/05: (chore) ci: use github.event instead of context

Posted by nf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8a6e799887cbf34985d96d198035696286d1d155
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Thu Nov 2 11:46:09 2023 +0100

    (chore) ci: use github.event instead of context
---
 .github/workflows/pr-comment.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml
index f63761b83f8..85310cca338 100644
--- a/.github/workflows/pr-comment.yml
+++ b/.github/workflows/pr-comment.yml
@@ -49,7 +49,7 @@ jobs:
           submodules: recursive
       - uses: ./.github/actions/create-or-update-comment
         with:
-          issue-number: ${{ context.issue.number }}
+          issue-number: ${{ github.event.issue.number }}
           body: |
             :robot: The Apache Camel test robot will run the tests for you :+1:
       - id: install-packages


(camel) 05/05: (chore) ci: replace comment on edit to provide the result

Posted by nf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b02b9df6acd9c7c830aa08f11921a525f84f9cdb
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Thu Nov 2 12:15:23 2023 +0100

    (chore) ci: replace comment on edit to provide the result
---
 .github/actions/component-test/action.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.github/actions/component-test/action.yaml b/.github/actions/component-test/action.yaml
index 1cb199577b2..cbd9a2a52a9 100644
--- a/.github/actions/component-test/action.yaml
+++ b/.github/actions/component-test/action.yaml
@@ -68,7 +68,9 @@ runs:
       uses: ./.github/actions/create-or-update-comment
       with:
         comment-id: ${{ inputs.comment-id }}
+        edit-mode: replace
         body: |
+          ${{ inputs.comment-body }}
 
           **Result** :white_check_mark: The tests passed successfully
     - name: Failure comment
@@ -76,6 +78,8 @@ runs:
       uses: ./.github/actions/create-or-update-comment
       with:
         comment-id: ${{ inputs.comment-id }}
+        edit-mode: replace
         body: |
+          ${{ inputs.comment-body }}
 
           **Result** :x: The tests failed please [check the logs](https://github.com/apache/camel/actions/runs/${{ inputs.run-id }})


(camel) 04/05: (chore) ci: fix the pr comment update to provide the result

Posted by nf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4bc4241ea31e2b3a2c21cd236245e844120f9410
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Thu Nov 2 11:57:47 2023 +0100

    (chore) ci: fix the pr comment update to provide the result
---
 .github/actions/component-test/action.yaml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/.github/actions/component-test/action.yaml b/.github/actions/component-test/action.yaml
index f9266dbdb66..1cb199577b2 100644
--- a/.github/actions/component-test/action.yaml
+++ b/.github/actions/component-test/action.yaml
@@ -69,7 +69,6 @@ runs:
       with:
         comment-id: ${{ inputs.comment-id }}
         body: |
-          ${{ inputs.comment-body }}
 
           **Result** :white_check_mark: The tests passed successfully
     - name: Failure comment
@@ -78,6 +77,5 @@ runs:
       with:
         comment-id: ${{ inputs.comment-id }}
         body: |
-          ${{ inputs.comment-body }}
 
           **Result** :x: The tests failed please [check the logs](https://github.com/apache/camel/actions/runs/${{ inputs.run-id }})