React Doctor in CI
A health score is most useful when you don't have to remember to run it.
Point React Doctor at a project and you get a 0-100 score in seconds. Put it in CI and you get that score on every pull request, before anything merges. AI writes more of your code every week, and CI is where you catch it when the quality slips.
name: React Doctor
on:
pull_request:
permissions:
contents: read
pull-requests: write
jobs:
react-doctor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: millionco/react-doctor@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
diff: ${{ github.base_ref }}
fail-on: error
annotations: trueThere's nothing to host. It runs on your existing GitHub Actions runners, the same scan you run locally.
Scoped to the diff
diff keeps the scan on the files the PR changed, so it stays fast even on a big
monorepo. annotations drops findings inline in the Files changed tab, on the
exact lines that introduced them. github-token posts a sticky comment with the
new score and the diff's findings, so review happens in the pull request instead
of your terminal.
Gate on it
fail-on: error fails the check when a PR adds new errors, so regressions never
merge. Want a stricter bar? Use fail-on: warning. Rolling it out on an old
codebase? Start with fail-on: none and tighten later. Every rule can be turned
off, downgraded, or scoped to a path, so the gate matches your standards instead
of fighting them.
Pin a version
@v1 tracks the latest v1.x, so you pick up patches and new rules for free.
For hardened CI, and especially any workflow with pull-requests: write, pin to
a full commit SHA and let Dependabot or Renovate keep it current:
- uses: millionco/react-doctor@b612664043a9be414166e3c6a69b355e39a8dcf4 # v1.1.1Get started
Run it locally and the score is a habit. Run it in CI and it's a guarantee.
Read the GitHub Actions setup guide, or see React Doctor in CI.