Universal code coverage gates for every CI pipeline

Test Verdict auto-detects coverage reports across 6 formats, computes overall and PR diff coverage, posts a sticky pull request summary, and enforces merge gates in GitHub Actions, Azure Pipelines, or any CI via CLI.

GitHub Action: steveswinsburg/test-verdict@v0 Azure Task: TestVerdict@0 CLI: npx test-verdict
Supported Formats

One gate across every language and test runner

Pass one or more report globs (even across mixed formats in the same monorepo). Test Verdict normalizes paths against your repository tree and merges overlapping line hits automatically.

LCOV

lcov

Vitest, Jest, c8, Istanbul, Rust (llvm-cov, tarpaulin), Flutter/Dart, C/C++, Ruby, PHP

Tracks lines, branches, functions, and PR diff lines.

Cobertura XML

cobertura

Python (pytest-cov, coverage.py), .NET (coverlet), Go (gocover-cobertura)

Tracks lines, branches, and PR diff line + branch coverage.

JaCoCo XML

jacoco

Java, Kotlin, Scala, Groovy (Gradle and Maven multi-module builds)

Resolves relative package paths like com/acme/App.java against git tracked files.

Istanbul / Jest JSON

istanbul

coverage-final.json and coverage-summary.json

Full line, branch, function, and PR diff metrics from coverage-final.json.

Go Coverprofile

gocover

Go native go test -coverprofile=coverage.out ./...

Strips module import prefixes; safely warns and skips branch/function gates.

OpenCover XML

opencover

.NET (OpenCover, AltCover)

Normalizes Windows separators and evaluates lines, branches, and methods.

Quickstart

Add Test Verdict in under two minutes

Choose your CI platform or run the standalone CLI locally. For production repos, see the hardened two-job configuration below.

.github/workflows/coverage.yml
name: Coverage Gate

on:
  pull_request:

permissions:
  contents: read
  pull-requests: write

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false
      - run: npm ci && npm test -- --coverage

      - if: ${{ !cancelled() && hashFiles('coverage/lcov.info') != '' }}
        uses: steveswinsburg/test-verdict@v0
        with:
          files: coverage/lcov.info
          min-line: 80
          min-diff-line: 90
Public GitHub App

Post as test-verdict-bot with zero stored secrets

Install the hosted Test Verdict GitHub App once on your repositories or organization, then swap pull-requests: write for id-token: write. No private keys, repository secrets, or custom app-url inputs are required.

1. Install the GitHub App

Choose the repositories or organization where you want Test Verdict to post. The Test Verdict Bot app requests only Pull requests: Read and write (plus GitHub's mandatory read-only Metadata) and never asks for write access to source code.

2. Swap one permission line

Grant id-token: write instead of pull-requests: write. Everything else stays identical, and on untrusted fork PRs or repos without the app installed, Test Verdict degrades cleanly to the Job Step Summary and exit-code gating.

.github/workflows/coverage.yml
name: Coverage Gate

on:
  pull_request:

permissions:
  contents: read
  id-token: write

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false
      - run: npm ci && npm test -- --coverage

      - if: ${{ !cancelled() && hashFiles('coverage/lcov.info') != '' }}
        uses: steveswinsburg/test-verdict@v0
        with:
          files: coverage/lcov.info
          min-line: 80
          min-diff-line: 90

How the token flow works: the Action requests a signed GitHub Actions OIDC JWT (core.getIDToken), exchanges it via the Cloudflare Worker broker (https://test-verdict-app.steve-swinsburg.workers.dev) for a single-repo pull_requests: write token, masks it with core.setSecret, and immediately revokes it (DELETE /installation/token) when the step finishes. In a hardened two-job workflow, only the verdict job needs id-token: write while the test job keeps contents: read.

Interactive Configurator

Build your workflow or config file

Pick your platform, coverage ecosystem, thresholds, and hardening options to generate a ready-to-paste snippet.

1. Platform & Ecosystem Preset
2. Coverage Thresholds (%)
3. Filters & Labels
4. Gate & Hardening Options
.github/workflows/coverage.yml
Reference

All inputs, outputs, flags, and config keys

Complete reference across the GitHub Action, Azure Pipelines task, standalone CLI, and optional .test-verdict.yml file.

GitHub Action Inputs (action.yml)
Input Default Description
files-Newline or comma-separated coverage report globs.
formatautoReport format override: auto, lcov, cobertura, jacoco, istanbul, gocover, or opencover.
config.test-verdict.ymlPath to optional YAML config file, or none / false to disable config loading.
include-Source path inclusion globs. Changed files matching include but absent from reports count as 0% diff coverage.
exclude-Newline or comma-separated source path exclusion globs.
report-iddefaultUnique identifier for sticky PR comments when running multiple steps or suites.
titleTest VerdictHeading shown at the top of PR comments and Job Step Summaries.
min-line-Minimum overall line coverage percentage (0-100).
min-branch-Minimum overall branch coverage percentage (0-100).
min-function-Minimum overall function coverage percentage (0-100).
min-diff-line-Minimum PR diff (changed lines) coverage percentage (0-100).
min-diff-branch-Minimum PR diff branch coverage percentage (0-100).
enforcetrueFail the check when configured coverage thresholds are breached.
fail-on-emptytrueFail when no report files match or parsed reports contain no measured source files.
commenttruePost or update a sticky PR comment with coverage results.
step-summarytrueWrite the full coverage breakdown to the GitHub Job Step Summary.
github-token${{ github.token }}Token used to read PR changed lines and post PR comments.
app-urlhttps://test-verdict-app.steve-swinsburg.workers.devHTTPS URL of the Test Verdict GitHub App OIDC token broker (Cloudflare Worker).
use-appautoUse GitHub App OIDC token exchange when app-url is set: auto, true, or false.
working-directory.Working directory containing the repository and coverage reports.
GitHub Action Outputs
Output Description
line-coverageOverall line coverage percentage, or empty if unavailable.
branch-coverageOverall branch coverage percentage, or empty if unavailable.
function-coverageOverall function coverage percentage, or empty if unavailable.
diff-coveragePR diff line coverage percentage, or empty if unavailable.
passed"true" or "false".
summary-jsonJSON payload summarizing overall metrics, groups, violations, and warnings.
Security & Troubleshooting

Hardening checklists and common pitfalls

Isolate pull-requests: write in a separate publish job

Avoid granting pull-requests: write to the same job that runs npm ci, yarn install, or unit tests. Run tests in a job with permissions: contents: read and persist-credentials: false on actions/checkout, upload coverage/lcov.info as an artifact, and evaluate Test Verdict in a second job that alone holds pull-requests: write.

LCOV, Istanbul, and Cobertura work in the publish job without checking out the repository. For JaCoCo XML reports, add actions/checkout with persist-credentials: false in the publish job so relative package paths resolve against tracked files.

Pin by commit SHA and disable PR-controlled config (config: none)

In high-security or private repositories, pin steveswinsburg/test-verdict@<full-commit-sha> instead of a mutable major tag.

Pass config: none in your workflow when you want to prevent a pull request branch from introducing a .test-verdict.yml that excludes files or alters settings. Even when an explicit config file is used, workflow-level thresholds act as a strict floor.

Guard against missing coverage reports after an early test crash

When running Test Verdict unconditionally with if: ${{ !cancelled() }}, a compile error or crashed test run that never produces coverage/lcov.info triggers a second red step. Use if: ${{ !cancelled() && hashFiles('coverage/lcov.info') != '' }} so Test Verdict only runs when a report exists.

Vitest tips: raw source globbing (1/1 inflation), coverage-v8 pinning, and ignores

If tests read source files using Vite's import.meta.glob(..., { query: '?raw' }), Vitest/V8 instruments untouched multi-line files as single-line modules (1/1 covered), artificially inflating coverage. Read source files with node:fs instead. Test Verdict also emits a SUSPICIOUS_SINGLE_LINE_COVERAGE warning if it detects multi-line files on disk reporting 1/1 covered.

Also pin @vitest/coverage-v8 to the exact same version as vitest, and add coverage/ to both .gitignore and ESLint ignores.

Custom PR comment bot name and avatar

By default, comments posted with GITHUB_TOKEN appear under github-actions Bot:

Default PR comment posted by github-actions Bot showing Test Verdict coverage summary

To post as test-verdict-bot with zero stored secrets, install the hosted Test Verdict GitHub App on your repository and grant id-token: write in your workflow. You can also self-host the Cloudflare Worker token broker from worker/README.md, or mint tokens manually with actions/create-github-app-token as shown in CUSTOM_BOT.md.