Configuration
React Doctor blocks pull requests by default, but it scans only changed files so old issues don't stop unrelated work. To map existing security and performance debt before you enforce the gate, run the first full scan in advisory mode:
- uses: millionco/react-doctor@v2
with:
blocking: none # or: warning or error
scope: full # or: changedblocking: none reports issues without failing the check. scope: full scans the whole project instead of only the changed files.
After the first pass, remove both options to use the default behavior: React Doctor blocks new warnings and errors on changed files. To roll out gradually, start with blocking: none, move to the default error gate next, and use blocking: warning only after the project has a stable baseline.
For more configuration options, see the Action reference.
Monorepos & subdirectories
Point the Action at an app in a subfolder with directory:
- uses: millionco/react-doctor@v2
with:
directory: apps/webBy default (project: "*") it finds and scans every React project. To scan only some, list them:
- uses: millionco/react-doctor@v2
with:
project: "web,admin"What happens on a pull request
On a pull request, React Doctor reports findings in three places: the PR conversation, inline review comments, and the CI logs.
When it finds a new issue on a changed line, it leaves an inline review comment, updates the same summary comment, and reports a failing commit status for branch protection. The check passes when the changed files have no findings.
Pushes to main only record the score, with no comment and no failure, so main never goes red over old issues.
Pull request feedback
The Action creates or updates one sticky summary comment instead of stacking new ones. It shows issue counts, the score, links each error to its file:line, groups warnings by file, and notes what your change added or fixed.
Inline review comments appear on the changed lines that triggered a diagnostic. Each includes a suggested fix and a link to the relevant docs, and React Doctor caps them so the summary stays the complete record.
Every run also includes the full terminal output in the CI logs, so reviewers can fall back to them when PR comments are disabled or unavailable.
Feedback controls
Use Action inputs to control where feedback appears:
- uses: millionco/react-doctor@v2
with:
comment: false
review-comments: false
commit-status: falsecomment needs issues: write, review-comments needs pull-requests: write, and commit-status needs statuses: write. To control what reaches the pull request comment, use surfaces.prComment in your React Doctor config.
Not on GitHub?
The scanner is a plain CLI, so it also runs on GitLab CI, CircleCI, Jenkins, and Buildkite. See Other CI providers.
Troubleshooting
It flagged tons of old issues on a PR. The checkout couldn't find where your PR started. Add fetch-depth: 0 to the actions/checkout step.
No comment showed up. Check the workflow has pull-requests: write and issues: write, and that comment isn't false. Comments never appear on push runs, only pull requests.
The status or score isn't showing. That needs statuses: write (unless you set commit-status: false). The Action warns in the run log when the permission is missing.
It's failing PRs before the team is ready. Set blocking: none to report findings without failing the workflow, then tighten later.
A failing check doesn't block the merge. Add the React Doctor check as required under Settings → Branches → Branch protection rules. Without that, a red check shows but the merge button still works.
PRs from forks don't get comments. GitHub blocks write access on fork PRs for security. The scan still runs and still passes or fails; it just can't post a comment.