|
| 1 | +# React Doctor — finds security, performance, correctness, accessibility, |
| 2 | +# bundle-size, and architecture issues in React codebases. |
| 3 | +# |
| 4 | +# Docs: https://www.react.doctor/ci |
| 5 | +# Source: https://github.com/millionco/react-doctor |
| 6 | + |
| 7 | +name: React Doctor |
| 8 | + |
| 9 | +on: |
| 10 | + # Scans the PR's changed files and posts a sticky summary comment listing only the new issues introduced relative to the merge base of the target branch. |
| 11 | + pull_request: |
| 12 | + types: [opened, synchronize, reopened, ready_for_review] |
| 13 | + # Scans `main` on every push to track the health-score trend and catch regressions that slipped past PR review. |
| 14 | + push: |
| 15 | + branches: ["main"] |
| 16 | + |
| 17 | +permissions: |
| 18 | + contents: read |
| 19 | + pull-requests: write |
| 20 | + issues: write |
| 21 | + statuses: write |
| 22 | + |
| 23 | +# Cancels any in-flight scan for the same PR (or branch, on push) the moment a new commit arrives, so reviewers only ever see the latest run. |
| 24 | +concurrency: |
| 25 | + group: react-doctor-${{ github.event.pull_request.number || github.ref }} |
| 26 | + cancel-in-progress: true |
| 27 | + |
| 28 | +jobs: |
| 29 | + react-doctor: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + fetch-depth: 0 |
| 35 | + |
| 36 | + - uses: millionco/react-doctor@v2 |
| 37 | + with: |
| 38 | + directory: frontend |
| 39 | + version: "0.5.8" |
| 40 | + # Advisory by default: React Doctor reports findings on every PR — a |
| 41 | + # sticky summary comment, inline review comments, and a commit status |
| 42 | + # with the health score — but never fails the check, so it won't red-X |
| 43 | + # a teammate's PR on day one. When your team trusts the signal, graduate |
| 44 | + # the gate: uncomment the block below and set blocking to "error" (fail |
| 45 | + # on new error-severity findings) or "warning" (fail on any finding). |
| 46 | + # Full reference: https://www.react.doctor/ci |
| 47 | + # blocking: error # Gate level: "none" (advisory, the default) | "warning" | "error" |
| 48 | + # scope: full # On PRs, scan the whole project instead of just changed files |
| 49 | + # comment: false # Disable the sticky PR summary comment |
| 50 | + # review-comments: false # Disable inline review comments on changed lines |
| 51 | + # commit-status: false # Disable the commit status (score + counts, links to the run) |
| 52 | + # project: "web,admin" # In a monorepo, scan specific workspace project(s) |
0 commit comments