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

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


The following commit(s) were added to refs/heads/main by this push:
     new 94faf43a26 ci: fix test results not commenting on PRs (#2462)
94faf43a26 is described below

commit 94faf43a267938c4e9d43a28841ec1e17be30d59
Author: JB Onofré <[email protected]>
AuthorDate: Thu Mar 19 11:21:59 2026 +0100

    ci: fix test results not commenting on PRs (#2462)
    
    The publish-unit-test-result-action in workflow_run mode needs the
    original event payload file to identify the associated PR. The CI
    workflow was not uploading it, and the test-results workflow was
    referencing a non-existent property (github.event.workflow_run.event_path).
    
    Upload the event file as a separate artifact in CI and download it in
    the test-results workflow so the action can correctly post PR comments.
---
 .github/workflows/ci-test-results.yml | 11 +++++++++--
 .github/workflows/ci.yml              |  6 ++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ci-test-results.yml 
b/.github/workflows/ci-test-results.yml
index 80476818c1..e9c4b75b8f 100644
--- a/.github/workflows/ci-test-results.yml
+++ b/.github/workflows/ci-test-results.yml
@@ -38,18 +38,25 @@ jobs:
     if: github.event.workflow_run.conclusion != 'skipped'
 
     steps:
-      - name: Download and Extract Artifacts
+      - name: Download Test Results
         uses: dawidd6/action-download-artifact@v19
         with:
           run_id: ${{ github.event.workflow_run.id }}
           name: test-results
           path: artifacts
 
+      - name: Download Event File
+        uses: dawidd6/action-download-artifact@v19
+        with:
+          run_id: ${{ github.event.workflow_run.id }}
+          name: event-file
+          path: event
+
       - name: Publish Test Results
         uses: EnricoMi/publish-unit-test-result-action@v2
         with:
           commit: ${{ github.event.workflow_run.head_sha }}
-          event_file: ${{ github.event.workflow_run.event_path }}
+          event_file: event/event.json
           event_name: ${{ github.event.workflow_run.event }}
           large_files: true
           report_individual_runs: true
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 11e8223f35..fb2c1e7c30 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -83,3 +83,9 @@ jobs:
         with:
           name: test-results
           path: '**/target/surefire-reports/*.xml'
+      - name: Upload Event File
+        if: always()
+        uses: actions/upload-artifact@v7
+        with:
+          name: event-file
+          path: ${{ github.event_path }}

Reply via email to