Dotnet Test Reporter

May 11, 2026 ยท View on GitHub

A GitHub action to parse test & coverage results and post them as a PR comment.

  • The action can process dotnet test results (a single or multiple .trx files), if there are any failing tests the action will fail. This allows integrating the action into your CI pipeline to short circuit and prevent further build/deploy operations as well as merging the code that caused tests to fail.
  • Optionally, test coverage can also be provided (a single opencover or cobertura .xml file) as well as a minimum coverage percentage threshold. If the threshold is provided and the coverage is not sufficient the action will also fail.
  • The action generates a workflow summary - a more detailed overview of processed tests and test coverage. For your convenience you can see the summary by following the link in the comment.
  • The action allows many configurations to suit your needs, please visit the Inputs and Examples sections.

Comment example

image

Summary - test results example

image

Summary - coverage results example

image

Tip

Despite this action was created specifically for dotnet you can use it with other languages and frameworks as long as you can generate .trx files. For example, your project can be a C#/dotnet backend with a TS/react frontend, in that case you would use the action twice. So if the frontend uses jest to run your tests, you can do this:

  • install jest-trx-results-processor package to generate .trx test result files
  • add cobertura to coverageReporters array and set coverage-type input to cobertura, in case you would like to include a coverage

Inputs

You can customize how the action works using one of the many inputs provided in the table below

InputRequiredTypeDefaultDescription
github-tokenyesstringGitHub repository token
Example: ${{ secrets.GITHUB_TOKEN }}
results-pathyesstringPath to the .trx file(s) containing test results. Supports glob patterns
Examples:
./TestResults/result.trx
./**/*.trx
coverage-pathnostring''Path to the file containing test coverage. Supports glob patterns
Examples:
./TestResults/coverage.xml
./**/coverage.xml
coverage-typenostringopencoverCoverage file type. Supported types are opencover and cobertura
Example: cobertura
coverage-thresholdnodecimal0.00Minimum allowed coverage. You can provide a coverage percentage ranging from 0.00 to 100.00
Example: 80.42
comment-titlenostringTest ResultsPull Request comment title
Example: My Custom Title
post-new-commentnobooleanfalseSet to true to post a new comment after each run
Set to false or leave blank to only update an existing comment
allow-failed-testsnobooleanfalseSet to true to prevent failed tests from failing the job
Set to false or leave blank to fail the job if there are any failed tests
show-failed-tests-onlynobooleanfalseSet to true to show only the failed tests. This is useful if you have many tests and the results exceed the markdown comment limit in github
Set to false or leave blank to show all the test results
show-test-outputnobooleantrueSet to true or leave blank to show the output of the tests
Set to false if there is too much output leading to truncation of the summary
pull-request-checknobooleanfalseSet to true to create GitHub status checks on the commit/PR for test results. These checks appear in the PR's "Checks" tab and can be used in branch protection rules
Set to false or leave blank to skip creating status checks
pull-request-check-namenostringTest ResultsName of the GitHub status check for test results. Only used when pull-request-check is set to true
Example: My Custom Test Check
changed-files-and-line-numbersnojson[]JSON array of changed files and lines numbers
Example:
'[{"name":"MyProject\\MyClass.cs","lineNumbers":[17,18,19]}]'
server-urlnostring''GitHub server URL. This is useful if you are using GitHub Enterprise Server
Example: ${{ github.server_url }}

Outputs

tests-total Total number of tests

tests-passed Number of tests passed

tests-failed Number of tests failed

tests-skipped Number of tests skipped

coverage-line Line code coverage

coverage-lines-total Total lines of code

coverage-lines-covered Lines of code covered

coverage-branch Branch code coverage

coverage-branches-total Total branches

coverage-branches-covered Branches covered

Examples

Important

Always use the latest version.

Important

Make sure to provide all required inputs.

uses: bibipkins/dotnet-test-reporter@v1.6.4
with:
  github-token: ${{ secrets.GITHUB_TOKEN }}
  comment-title: 'Unit Test Results'
  results-path: ./TestResults/*.trx
  coverage-path: ./TestResults/coverage.xml
  coverage-threshold: 80