From a12918d65732c898e1bce13a7e0e27c6204a7bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JB=20Onofr=C3=A9?= Date: Thu, 19 Mar 2026 11:00:07 +0100 Subject: [PATCH] ci: fix test results not commenting on PRs 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 80476818c11..e9c4b75b8fe 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 3ebc9a54454..4fb346e14f2 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 }}