fgrosse/Go Unit Test Coverage Report

Post Go code coverage reports to pull requests.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jul 4, 2026
License
BSD

Pinned Snippet

workflow.ymlSHA-pinned
uses: fgrosse/go-coverage-report@cbeb2ab2e32591d690337146ba02a911cc566f3f # v1.3.0

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
versionThe exact version tag of the go-coverage-report tool to use.yesv1.3.1
sha256sumOptional SHA256 checksum of the tarball when downloading the go-coverage-report binary.no
coverage-artifact-nameThe name of the artifact containing the code coverage results.yescode-coverage
coverage-file-nameThe name of the file containing the code coverage results.yescoverage.txt
root-packageThe Go import path of the tested repository to add as a prefix to all paths of the changed files. This is useful to map the changed files (e.g., ["foo/my_file.go"] to their coverage profile which uses the full package name to identify the files (e.g., "github.com/fgrosse/example/foo/my_file.go"). Note that currently, packages with a different name than their directory are not supported. nogithub.com/${{ github.repository }}
skip-commentSkip creating or updating the pull request comment. This may be useful when you want to generate the coverage report and modify it in your own scripts. nofalse
trimTrim a prefix in the "Impacted Packages" column of the markdown report.no
excludeExclude files matching the given regular expression from the report.no
github-baseline-workflow-refThe ref of the GitHub actions Workflow that produces the baseline coverage. By default, the GitHub Actions Workflow ref is used (e.g. "octocat/hello-world/.github/workflows/my-workflow.yml@refs/heads/my_branch"). You can aso just pass the name of the Workflow file directly (e.g. "my-workflow.yml"). no${{ github.workflow_ref }}
event-nameThe event that triggered the workflow used to filter baseline runs.nopush
target-branchThe base branch to compare the coverage results against. Defaults to github.base_ref, which is only set on pull_request events. For other event types (e.g. push, schedule), set this explicitly. no${{ github.base_ref }}
namedescription
coverage_reportThe generated coverage report in Markdown format.
total_coverageNew overall test coverage percentage (e.g. "85.23").
coverage_deltaChange in coverage compared to the baseline (e.g. "-2.13"). Positive means increase.
coverage_trendDirection of coverage change: "increased", "decreased", or "no change".
total_statementsTotal number of statements in the new coverage profile.
covered_statementsNumber of covered statements in the new coverage profile.
missed_statementsNumber of missed (uncovered) statements in the new coverage profile.