actions-marketplace-validations/Pytest Coverage Comment
GitHub Action that adds pytest coverage reports as comments to pull requests with badges, test statistics, and direct file links. Requires pull-requests: write permission.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Apr 18, 2026
- License
- MIT
Pinned Snippet
uses: actions-marketplace-validations/mishakav_pytest-coverage-comment@a01708271d42c5703d489b13eb503ba47c01e82a # no releases — HEAD as of 2026-07-10tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| github-token | GitHub token for API access to create/update comments. Ensure your workflow has pull-requests: write permission. | yes | ${{ github.token }} |
| pytest-coverage-path | Path to pytest text coverage output (from --cov-report=term-missing) | no | ./pytest-coverage.txt |
| issue-number | Pull request number to comment on (required for workflow_dispatch/workflow_run events) | no | "" |
| pytest-xml-coverage-path | Path to XML coverage report (from --cov-report=xml:coverage.xml) | no | "" |
| coverage-path-prefix | Prefix to add to file paths in coverage report links | no | "" |
| title | Main title for the coverage comment (useful for monorepo projects) | no | Coverage Report |
| badge-title | Text shown on the coverage percentage badge | no | Coverage |
| hide-badge | Hide the coverage percentage badge from the comment | no | false |
| hide-report | Hide the detailed coverage table (show only summary and badge) | no | false |
| hide-comment | Skip creating PR comment entirely (useful for using outputs only) | no | false |
| hide-emoji | Hide emojis in the test summary table (skipped/failures/errors/time columns) | no | false |
| xml-skip-covered | Hide files with 100% coverage from XML coverage reports | no | false |
| report-only-changed-files | Show only files changed in the current pull request | no | false |
| junitxml-path | Path to JUnit XML file for test statistics (passed/failed/skipped) | no | "" |
| junitxml-title | Title for the test summary section from JUnit XML | no | "" |
| create-new-comment | Create new comment on each run instead of updating existing comment | no | false |
| default-branch | Base branch name for file links in coverage report (e.g., main, master) | no | main |
| multiple-files | Generate single comment with multiple coverage reports (useful for monorepos). Format: One report per line as "Title, coverage-path, junit-path". Coverage path can be TXT (from --cov-report=term-missing) or XML (from --cov-report=xml). Examples: "Backend API, ./backend/coverage.txt, ./backend/junit.xml" "Frontend Tests, ./frontend/coverage.xml, ./frontend/junit.xml" | no | "" |
| remove-link-from-badge | Remove hyperlink from coverage badge (badge becomes plain image) | no | false |
| unique-id-for-comment | Unique identifier for matrix builds to update separate comments (e.g., matrix.python-version) | no | "" |
| remove-links-to-files | Remove file links from coverage table to reduce comment size | no | false |
| remove-links-to-lines | Remove line number links from coverage table to reduce comment size | no | false |
| text-instead-badge | Use simple text instead of badge images for coverage display | no | false |
Outputs
| name | description |
|---|---|
| coverage | Coverage percentage from pytest report (e.g., 85%) |
| color | Badge color based on coverage percentage (red/orange/yellow/green/brightgreen) |
| coverageHtml | Full HTML coverage report with clickable links to uncovered lines |
| summaryReport | Test summary in markdown format with statistics (tests/skipped/failures/errors/time) |
| warnings | Number of coverage warnings from pytest-cov |
| tests | Total number of tests run (from JUnit XML) |
| skipped | Number of skipped tests (from JUnit XML) |
| failures | Number of failed tests (from JUnit XML) |
| errors | Number of test errors (from JUnit XML) |
| time | Test execution time in seconds (from JUnit XML) |
| notSuccessTestInfo | JSON details of failed, errored, and skipped tests (from JUnit XML) |