# GitHub Action reference

Every input, output, and permission for the [`millionco/react-doctor`](https://github.com/marketplace/actions/react-doctor) Action. For setup and the full workflow file, see [GitHub Actions setup](/docs/ci-and-prs/github-actions-setup).

## Inputs

Set inputs with a `with:` block under the step. Every input is optional.

```yaml
- uses: millionco/react-doctor@v2
  with:
    blocking: warning
    scope: full
```

<table>
  <thead>
    <tr>
      <th>Input</th>
      <th>Default</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <code>blocking</code>
      </td>
      <td>
        <code>error</code>
      </td>
      <td>
        Severity that fails the workflow: <code>error</code>,{" "}
        <code>warning</code>, or <code>none</code> (advisory)
      </td>
    </tr>
    <tr>
      <td>
        <code>scope</code>
      </td>
      <td>
        <code>changed</code>
      </td>
      <td>
        On pull requests, <code>changed</code> (only changed files, baseline) or{" "}
        <code>full</code> (the whole project). Other events always scan
        everything
      </td>
    </tr>
    <tr>
      <td>
        <code>comment</code>
      </td>
      <td>
        <code>true</code>
      </td>
      <td>Create or update a sticky PR summary comment</td>
    </tr>
    <tr>
      <td>
        <code>review-comments</code>
      </td>
      <td>
        <code>true</code>
      </td>
      <td>Post inline review comments on changed lines (pull requests only)</td>
    </tr>
    <tr>
      <td>
        <code>commit-status</code>
      </td>
      <td>
        <code>true</code>
      </td>
      <td>
        Show the score and error/warning counts next to the commit (needs{" "}
        <code>statuses: write</code>)
      </td>
    </tr>
    <tr>
      <td>
        <code>project</code>
      </td>
      <td>
        <code>*</code>
      </td>
      <td>
        Workspace project(s) to scan, comma-separated. <code>*</code> scans
        every discovered project
      </td>
    </tr>
    <tr>
      <td>
        <code>directory</code>
      </td>
      <td>
        <code>.</code>
      </td>
      <td>Project directory to scan</td>
    </tr>
    <tr>
      <td>
        <code>node-version</code>
      </td>
      <td>
        <code>24</code>
      </td>
      <td>Node.js version to use</td>
    </tr>
    <tr>
      <td>
        <code>version</code>
      </td>
      <td>
        <code>latest</code>
      </td>
      <td>
        <code>react-doctor</code> npm version or package spec to run
      </td>
    </tr>
  </tbody>
</table>

## Outputs

Read outputs in later steps with `${{ steps.<step-id>.outputs.<name> }}`.

<table>
  <thead>
    <tr>
      <th>Output</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <code>score</code>
      </td>
      <td>Health score (0 to 100). Empty when scoring was unavailable</td>
    </tr>
    <tr>
      <td>
        <code>total-issues</code>
      </td>
      <td>
        Total diagnostics; on pull requests, the number your change introduced
      </td>
    </tr>
    <tr>
      <td>
        <code>fixed-issues</code>
      </td>
      <td>
        On pull requests, the number of issues your change resolved (otherwise
        0)
      </td>
    </tr>
    <tr>
      <td>
        <code>error-count</code>
      </td>
      <td>Error diagnostic count</td>
    </tr>
    <tr>
      <td>
        <code>warning-count</code>
      </td>
      <td>Warning diagnostic count</td>
    </tr>
    <tr>
      <td>
        <code>affected-files</code>
      </td>
      <td>Number of files with diagnostics</td>
    </tr>
  </tbody>
</table>

The `score` output is empty in offline mode, or when the score API is unreachable, so handle that case if you read it in a later step.

## Permissions

A workflow can only read your code by default. The Action needs these added under `permissions:`.

<table>
  <thead>
    <tr>
      <th>Permission</th>
      <th>Why it is needed</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <code>contents: read</code>
      </td>
      <td>Check out and read your code. Required</td>
    </tr>
    <tr>
      <td>
        <code>pull-requests: write</code>
      </td>
      <td>
        Read the changed-file list and post inline review comments. Drop to{" "}
        <code>read</code> to keep the changed-files scan without comments
      </td>
    </tr>
    <tr>
      <td>
        <code>issues: write</code>
      </td>
      <td>
        Post the sticky summary comment (a PR comment uses the issues API)
      </td>
    </tr>
    <tr>
      <td>
        <code>statuses: write</code>
      </td>
      <td>
        Show the score and counts next to the commit. Omit if you set{" "}
        <code>commit-status: false</code>
      </td>
    </tr>
  </tbody>
</table>
