fgrosse/Go Unit Test Coverage Report
Post Go code coverage reports to pull requests.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Jul 4, 2026
- License
- BSD
Pinned Snippet
uses: fgrosse/go-coverage-report@cbeb2ab2e32591d690337146ba02a911cc566f3f # v1.3.0tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| version | The exact version tag of the go-coverage-report tool to use. | yes | v1.3.1 |
| sha256sum | Optional SHA256 checksum of the tarball when downloading the go-coverage-report binary. | no | — |
| coverage-artifact-name | The name of the artifact containing the code coverage results. | yes | code-coverage |
| coverage-file-name | The name of the file containing the code coverage results. | yes | coverage.txt |
| root-package | The 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. | no | github.com/${{ github.repository }} |
| skip-comment | Skip 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. | no | false |
| trim | Trim a prefix in the "Impacted Packages" column of the markdown report. | no | — |
| exclude | Exclude files matching the given regular expression from the report. | no | — |
| github-baseline-workflow-ref | The 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-name | The event that triggered the workflow used to filter baseline runs. | no | push |
| target-branch | The 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 }} |
Outputs
| name | description |
|---|---|
| coverage_report | The generated coverage report in Markdown format. |
| total_coverage | New overall test coverage percentage (e.g. "85.23"). |
| coverage_delta | Change in coverage compared to the baseline (e.g. "-2.13"). Positive means increase. |
| coverage_trend | Direction of coverage change: "increased", "decreased", or "no change". |
| total_statements | Total number of statements in the new coverage profile. |
| covered_statements | Number of covered statements in the new coverage profile. |
| missed_statements | Number of missed (uncovered) statements in the new coverage profile. |