Skip to content

Commit 6abfdd8

Browse files
authored
Fix not reporting test results on push to main (#921)
Allow other events to report test results
1 parent b95f57c commit 6abfdd8

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/integration-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ jobs:
130130
- name: Report test results
131131
id: report
132132
uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 # v2.1.1
133-
if: github.event.pull_request.head.repo.full_name == github.repository && !cancelled()
133+
# This will skip the job if it's a pull request from a fork, because that won't have permission to upload test results.
134+
# PRs from the repository and all other events are OK.
135+
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository) && !cancelled()
134136
with:
135137
name: Test Results
136138
path: "junit.xml*"

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ jobs:
5454

5555
- name: Report test results
5656
uses: dorny/test-reporter@dc3a92680fcc15842eef52e8c4606ea7ce6bd3f3 # v2.1.1
57-
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && !cancelled() }}
57+
# This will skip the job if it's a pull request from a fork, because that won't have permission to upload test results.
58+
# PRs from the repository and all other events are OK.
59+
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository) && !cancelled()
5860
with:
5961
name: Test Results
6062
path: "junit.xml"

0 commit comments

Comments
 (0)