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/31 08:32:32 UTC

[camel] branch main updated: component-test - Propagate the github token

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 01f9cf6ad04 component-test - Propagate the github token
01f9cf6ad04 is described below

commit 01f9cf6ad04f254897c156b4ff512977c2c14fa5
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Wed May 31 10:32:07 2023 +0200

    component-test - Propagate the github token
---
 .github/actions/component-test/action.yaml | 8 ++++++--
 .github/workflows/pr-comment.yml           | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/actions/component-test/action.yaml b/.github/actions/component-test/action.yaml
index ba45de16848..085a279489d 100644
--- a/.github/actions/component-test/action.yaml
+++ b/.github/actions/component-test/action.yaml
@@ -18,6 +18,9 @@
 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
   pr-id:
     description: 'Id of the pull request to update'
     required: true
@@ -53,13 +56,14 @@ runs:
     - name: Dump GitHub context
       env:
         GITHUB_CONTEXT: ${{ toJson(github) }}
+      shell: bash
       run: |
         echo "$GITHUB_CONTEXT"
     - name: Success comment
       if: success()
       uses: actions/github-script@v6
       with:
-        github-token: ${{ secrets.GITHUB_TOKEN }}
+        github-token: ${{ inputs.github-token }}
         script: |
           await github.rest.issues.updateComment({
                 owner: context.repo.owner,
@@ -73,7 +77,7 @@ runs:
       if: failure()
       uses: actions/github-script@v6
       with:
-        github-token: ${{ secrets.GITHUB_TOKEN }}
+        github-token: ${{ inputs.github-token }}
         script: |
           var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
              owner: context.repo.owner,
diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml
index ea891a66e80..dba47320010 100644
--- a/.github/workflows/pr-comment.yml
+++ b/.github/workflows/pr-comment.yml
@@ -63,6 +63,7 @@ jobs:
         name: Component test execution
         uses: ./.github/actions/component-test
         with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
           pr-id: ${{ github.event.issue.number.id }}
           comment-id: ${{ github.event.comment.id }}
           comment-body: ${{ github.event.comment.body }}