Every repo I’ve worked in has a coverage number. Ours says 84%. It’s said 84% for about a year.
Someone opens a PR, adds a hundred lines with no tests, and the number drifts from 84.1% to 83.6%. Nobody blocks a PR over half a percent.. you’d look insane. So the untested code walks right in, the number stays put, and six months later “84%” is sitting on a growing pile of stuff nobody ever tested.
Grade the Diff
Stop grading the whole repo. Grade the lines this PR changed. It’s called patch coverage, and Codecov and friends have done it for years. I wanted a version that was dead simple, didn’t care what language you write in, and never sent anything off the runner.
difftron is a small Go CLI wrapped as a GitHub Action. Point it at an LCOV, Cobertura, or Go coverage file, and it diffs against the base branch and grades only the changed lines:
- uses: swantron/difftron@v1
with:
coverage: coverage/lcov.info
threshold: '80'
You get a sticky PR comment with the uncovered line numbers, and a failed check if you’re under the threshold. Or it just comments, if you set fail-on-error: false while you ease into it.
Dogfooding
I dropped it onto six of my own repos in an afternoon.. Go tools, a couple of vitest apps, two that needed c8 to turn node --test into an lcov file. Same four lines of yaml every time.
On tronswan I planted a tested function next to an untested one and opened a throwaway PR. difftron graded the 15 changed lines.. 1 covered, 14 not. The project-wide number barely moved.

v1 had a great bug: it failed a docs-only PR. Edit a README, there’s no coverage data for markdown, difftron reads that as 0%, PR fails. Instant uninstall. Now files with no coverage signal get skipped instead of failed, and the comment tells you which ones.
Marketplace: Difftron Delta Coverage Gate
Source: github.com/swantron/difftron
The repo can say 84% forever. Your diff has to earn it.