Skip to content

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

react-doctor-action

GitHub Marketplace License: MIT GitHub Stars

GitHub Action CI companion for react-doctor

Automatically run react-doctor diagnostics on every pull request, post findings as PR comments, and optionally fail CI if issues exceed a configurable threshold.

react-doctor: 11,928 GitHub stars • 324,593 weekly npm downloads • Created Feb 2026

Usage

# .github/workflows/react-doctor.yml
name: React Doctor CI

on:
  pull_request:
    branches: [main, develop]

jobs:
  react-doctor:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: '20'

      - uses: icgriggs14/react-doctor-action@v1
        with:
          threshold: 10
          fail_on_error: true
          paths: 'src'

Inputs

Input Description Default
threshold Fail CI if total issue count exceeds this number 10
fail_on_error Fail CI if any error-level issues are found true
paths Space-separated paths or globs to check src
github_token GitHub token for posting PR comments ${{ github.token }}

Outputs

Output Description
issue_count Total number of issues found
error_count Number of error-level issues
warning_count Number of warning-level issues

PR Comment Example

The action posts a structured comment on every PR:

## 🟡 React Doctor — Warnings found

| Metric | Count |
|--------|-------|
| 🔴 Errors | 0 |
| 🟡 Warnings | 3 |
| 💡 Suggestions | 7 |
| Total Issues | 10 |

<details>
<summary>Issue details (10)</summary>
- warning src/components/UserCard.jsx:42: Potential XSS via dangerouslySetInnerHTML
...
</details>

Use only specific paths

- uses: icgriggs14/react-doctor-action@v1
  with:
    paths: 'src/components src/pages'
    threshold: 5

Lenient mode (comment only, never fail)

- uses: icgriggs14/react-doctor-action@v1
  with:
    threshold: 9999
    fail_on_error: false

Support this project

If this Action saves you time, consider sponsoring on GitHub Sponsors.

More tools by the same author:

License

MIT

Related tools

These companion Actions from the same author work great together:

Sponsor this work on GitHub Sponsors

Releases

Packages

Contributors

Languages