From 6abfdd8a883481523fb99db2fe11222b3fe94a9f Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Tue, 18 Nov 2025 08:50:19 +1000 Subject: [PATCH] Fix not reporting test results on push to main (#921) Allow other events to report test results --- .github/workflows/integration-test.yml | 4 +++- .github/workflows/test.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 05dc69ab..b18d6ec3 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -130,7 +130,9 @@ jobs: - name: Report test results id: report uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 # v2.1.1 - if: github.event.pull_request.head.repo.full_name == github.repository && !cancelled() + # This will skip the job if it's a pull request from a fork, because that won't have permission to upload test results. + # PRs from the repository and all other events are OK. + if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository) && !cancelled() with: name: Test Results path: "junit.xml*" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c776df21..1e4f9f8f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,7 +54,9 @@ jobs: - name: Report test results uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 # v2.1.1 - if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !cancelled() }} + # This will skip the job if it's a pull request from a fork, because that won't have permission to upload test results. + # PRs from the repository and all other events are OK. + if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository) && !cancelled() with: name: Test Results path: "junit.xml"