Skip to content
Latchkey

mikepenz/action-junit-report

Publish JUnit XML results as a check run with PR annotations and a job summary.

Community actionCategory: Testing & CoverageLatest v6View on GitHub

What it does

mikepenz/action-junit-report reads JUnit-format XML reports and annotates failing tests directly on the pull request, so failures are visible without digging through logs.

It can also render a job summary, comment on the PR, track flaky (retried) tests, and expose pass/fail counts as outputs.

Usage

workflow (.yml)
permissions:
  contents: read
  checks: write
steps:
  - uses: actions/checkout@v4
  - run: ./gradlew test
  - uses: mikepenz/action-junit-report@v6
    if: ${{ !cancelled() }}
    with:
      report_paths: '**/build/test-results/test/TEST-*.xml'
      fail_on_failure: 'true'

Inputs

InputDescriptionDefaultRequired
report_pathsXML report paths in glob format.**/junit-reports/TEST-*.xmlNo
check_nameCheck name for test reports.JUnit Test ReportNo
fail_on_failureFail the build in case a test failure occurred.falseNo
require_testsFail if no tests are found.falseNo
annotate_onlyOnly annotate the results on the files; do not create a check run.falseNo
detailed_summaryInclude a table with all test results in the summary.falseNo
commentAdd a comment to the PR with the summary tables (summary has to be enabled).falseNo
tokenToken used to publish the check.${{ github.token }}No

Outputs

OutputDescription
totalThe total count of all checks.
passedThe count of all passed tests.
skippedThe count of all skipped tests.
failedThe count of all failed tests.
report_urlThe URL(s) to the test report(s).

Notes

The action does not fail the build by default, set fail_on_failure: true if the report step should gate the merge, and require_tests: true to catch silently-empty reports.

Run it with if: ${{ !cancelled() }} so reports publish even when the test step fails.

Common errors

  • Resource not accessible by integration means the token cannot create check runs, add checks: write to permissions, or set annotate_only: true / move to a workflow_run workflow for fork PRs.
  • An empty report usually means the default report_paths glob (**/junit-reports/TEST-*.xml) did not match your tool's output directory. Point it at the actual XML location, e.g. **/build/test-results/test/TEST-*.xml for Gradle.

Security and pinning

  • Grant only checks: write plus contents: read; add pull-requests: write only if you enable the comment input.
  • Pin the action to a commit SHA, it receives a token that can write checks and PR comments.

Alternatives and related

Frequently asked questions

Why did my workflow stay green even though tests failed?
The reporter defaults to fail_on_failure: false, so it only reports. Set fail_on_failure: true (and usually require_tests: true) to make the step fail with the tests.
Running mikepenz/action-junit-report? Run it on Latchkey managed runners - self-healing and caching included. Start free → 30-day trial · No credit card