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

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


The following commit(s) were added to refs/heads/karaf-4.4.x by this push:
     new 28fbd73da5 ci: fix test results not commenting on PRs (#2463)
28fbd73da5 is described below

commit 28fbd73da58dfa7b0fe57d012e9b4b091e06cac0
Author: JB Onofré <[email protected]>
AuthorDate: Thu Mar 19 15:22:09 2026 +0100

    ci: fix test results not commenting on PRs (#2463)
    
    Backport of #2462 to karaf-4.4.x.
    
    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 3ebc9a5445..4fb346e14f 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