Skip to content
Latchkey

dorny/test-reporter

Turn test result files (JUnit, TRX, JSON) into a GitHub check run with annotations.

Community actionCategory: Testing & CoverageLatest v3View on GitHub

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-junit

Inputs

InputDescriptionDefaultRequired
nameName of the check run.-Yes
pathComma-separated list of paths to test results (supports glob wildcards).-Yes
reporterFormat of test results, e.g. java-junit, jest-junit, dotnet-trx, golang-json.-Yes
fail-on-errorSet this action as failed if the test report contains any failed test.trueNo
fail-on-emptySet this action as failed if no test results were found.trueYes
max-annotationsLimit of created annotations (must be 50 or less).10No
artifactName or regex of an artifact containing test results (for workflow_run setups).-No

Outputs

OutputDescription
conclusion'success' if no failed tests were found, otherwise 'failure'.
passedCount of passed tests.
failedCount of failed tests.
skippedCount of skipped tests.
timeTest 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 integration means the job token cannot create check runs, add checks: write to permissions, or for fork PRs move the reporter to a workflow_run workflow.
  • A failure about no test report files found means the path glob matched nothing. Check the working directory and that the test step actually wrote the result file.

Security and pinning

  • Grant only checks: write (plus contents: read), the action does not need broader permissions.
  • In workflow_run setups 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

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.
Running dorny/test-reporter? Run it on Latchkey managed runners - self-healing and caching included. Start free → 30-day trial · No credit card