mishakav/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 GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
github-tokenGitHub token for API access to create/update comments. Ensure your workflow has pull-requests: write permission.yes${{ github.token }}
pytest-coverage-pathPath to pytest text coverage output (from --cov-report=term-missing)no./pytest-coverage.txt
issue-numberPull request number to comment on (required for workflow_dispatch/workflow_run events)no""
pytest-xml-coverage-pathPath to XML coverage report (from --cov-report=xml:coverage.xml)no""
pytest-json-coverage-pathPath to JSON coverage report (from coverage json)no""
coverage-path-prefixPrefix to add to file paths in coverage report linksno""
titleMain title for the coverage comment (useful for monorepo projects)noCoverage Report
badge-titleText shown on the coverage percentage badgenoCoverage
hide-badgeHide the coverage percentage badge from the commentnofalse
hide-reportHide the detailed coverage table (show only summary and badge)nofalse
hide-commentSkip creating PR comment entirely (useful for using outputs only)nofalse
hide-emojiHide emojis in the test summary table (skipped/failures/errors/time columns)nofalse
xml-skip-coveredHide files with 100% coverage from XML coverage reportsnofalse
report-only-changed-filesShow only files changed in the current pull requestnofalse
junitxml-pathPath to JUnit XML file for test statistics (passed/failed/skipped)no""
junitxml-titleTitle for the test summary section from JUnit XMLno""
create-new-commentCreate new comment on each run instead of updating existing commentnofalse
default-branchBase branch name for file links in coverage report (e.g., main, master)nomain
multiple-filesGenerate 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), XML (from --cov-report=xml), or JSON (from coverage json). Examples: "Backend API, ./backend/coverage.txt, ./backend/junit.xml" "Frontend Tests, ./frontend/coverage.xml, ./frontend/junit.xml" no""
remove-link-from-badgeRemove hyperlink from coverage badge (badge becomes plain image)nofalse
unique-id-for-commentUnique identifier for matrix builds to update separate comments (e.g., matrix.python-version)no""
remove-links-to-filesRemove file links from coverage table to reduce comment sizenofalse
remove-links-to-linesRemove line number links from coverage table to reduce comment sizenofalse
text-instead-badgeUse simple text instead of badge images for coverage displaynofalse
namedescription
coverageCoverage percentage from pytest report (e.g., 85%)
colorBadge color based on coverage percentage (red/orange/yellow/green/brightgreen)
coverageHtmlFull HTML coverage report with clickable links to uncovered lines
summaryReportTest summary in markdown format with statistics (tests/skipped/failures/errors/time)
warningsNumber of coverage warnings from pytest-cov
testsTotal number of tests run (from JUnit XML)
skippedNumber of skipped tests (from JUnit XML)
failuresNumber of failed tests (from JUnit XML)
errorsNumber of test errors (from JUnit XML)
timeTest execution time in seconds (from JUnit XML)
notSuccessTestInfoJSON details of failed, errored, and skipped tests (from JUnit XML)