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

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

commit e87135c8ce4823a7c6dd6a4ac9fddcccbafa4454
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Thu Mar 31 18:08:43 2022 +0200

    (chores) ci: save the PR number to comment later
---
 .github/actions/quick-test/action.yaml | 5 +++++
 .github/workflows/component-pr.yaml    | 8 +++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/.github/actions/quick-test/action.yaml 
b/.github/actions/quick-test/action.yaml
index 5e99e8e..78c7398 100644
--- a/.github/actions/quick-test/action.yaml
+++ b/.github/actions/quick-test/action.yaml
@@ -26,6 +26,11 @@ runs:
     - id: quick-test
       run: ${{ github.action_path }}/quick-test.sh ${{ inputs.start-commit }} 
${{ inputs.end-commit }}
       shell: bash
+    - name: Save PR number
+      env:
+        PR_NUMBER: ${{ github.event.number }}
+      shell: bash
+      run: echo $PR_NUMBER > ./automated-build-log/pr_number
     - name: archive logs
       uses: actions/upload-artifact@v3
       if: always()
diff --git a/.github/workflows/component-pr.yaml 
b/.github/workflows/component-pr.yaml
index 2cc5294..b5ed688 100644
--- a/.github/workflows/component-pr.yaml
+++ b/.github/workflows/component-pr.yaml
@@ -53,7 +53,9 @@ jobs:
         if: |
           github.event_name == 'workflow_run'
         with:
-# Secure download based on 
https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
+# Secure download based on:
+# - 
https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
+# - 
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run
           script: |
             var artifacts = await github.actions.listWorkflowRunArtifacts({
                owner: context.repo.owner,
@@ -85,10 +87,10 @@ jobs:
         with:
           github-token: ${{ secrets.GITHUB_TOKEN }}
           script: |
-            const { RESULT, COUNT } = process.env
+            let issue_number = 
Number(fs.readFileSync('./automated-build-log/pr_number'));
             
             github.rest.issues.createComment({
-              issue_number: context.issue.number,
+              issue_number: issue_number,
               owner: context.repo.owner,
               repo: context.repo.repo,
               body: "${{ env.result }}

Reply via email to