dorny/test-reporter
Turn test result files (JUnit, TRX, JSON) into a GitHub check run with annotations.
What it does
dorny/test-reporter reads test result files produced by your test step and renders them directly in GitHub, a check run with pass/fail counts, suite listings, and annotations pointing at failing tests.
It supports many formats (java-junit, jest-junit, dotnet-trx, golang-json, mocha-json, and others) selected via the reporter input.
Usage
workflow (.yml)
permissions:
contents: read
checks: write
steps:
- uses: actions/checkout@v4
- run: npm ci && npm test # configured to emit junit.xml (e.g. jest-junit)
- uses: dorny/test-reporter@v3
if: ${{ !cancelled() }}
with:
name: Jest tests
path: junit.xml
reporter: jest-junitInputs
| Input | Description | Default | Required |
|---|---|---|---|
name | Name of the check run. | - | Yes |
path | Comma-separated list of paths to test results (supports glob wildcards). | - | Yes |
reporter | Format of test results, e.g. java-junit, jest-junit, dotnet-trx, golang-json. | - | Yes |
fail-on-error | Set this action as failed if the test report contains any failed test. | true | No |
fail-on-empty | Set this action as failed if no test results were found. | true | Yes |
max-annotations | Limit of created annotations (must be 50 or less). | 10 | No |
artifact | Name or regex of an artifact containing test results (for workflow_run setups). | - | No |
Outputs
| Output | Description |
|---|---|
conclusion | 'success' if no failed tests were found, otherwise 'failure'. |
passed | Count of passed tests. |
failed | Count of failed tests. |
skipped | Count of skipped tests. |
time | Test execution time in ms. |
Notes
Run the reporter with if: ${{ !cancelled() }} so it still publishes when the test step fails, that is exactly when you want the report.
For pull requests from forks the job token cannot create check runs; upload results as an artifact and run the reporter in a separate workflow_run workflow using the artifact input.
Common errors
HttpError: Resource not accessible by integrationmeans the job token cannot create check runs, addchecks: writetopermissions, or for fork PRs move the reporter to aworkflow_runworkflow.- A failure about no test report files found means the
pathglob matched nothing. Check the working directory and that the test step actually wrote the result file.
Security and pinning
- Grant only
checks: write(pluscontents: read), the action does not need broader permissions. - In
workflow_runsetups the reporter runs with elevated permissions on untrusted fork results; keep it to parsing artifacts and pin the action to a commit SHA.
Alternatives and related
mikepenz/action-junit-reportPublish JUnit XML results as a check run with PR annotations and a job summary.
codecov/codecov-actionUpload test coverage reports to Codecov from a workflow.
actions/upload-artifactUpload files from a job so other jobs or a person can download them after the run.
Frequently asked questions
Why is there no test report on pull requests from forks?
Fork PR tokens are read-only, so the check run cannot be created. Upload the results as an artifact in the PR workflow, then run test-reporter in a
workflow_run triggered workflow with the artifact input.