## TL;DR
reviewdog reports an empty diff when it cannot compute the change set, almost always because the checkout is too shallow to see the base commit, or because the draft PR genuinely has no commits yet. Fetch full history (or at least the base branch) in the workflow checkout, push any missing commits, and rerun. reviewdog needs the base commit locally to build the diff.

```text
reviewdog: diff is empty
```

1. Confirm the PR has changes: `gh pr view 123 --json commits --jq '.commits | length'`. Expected: a number greater than zero. If zero, push the commits first; there is nothing to review yet.
2. Fix the checkout in the workflow. With actions/checkout, fetch full history so reviewdog can diff against the base:
```yaml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0
```
Expected: the step checks out full history.
3. To keep the clone small, fetch just the base ref instead:
```yaml
- uses: actions/checkout@v4
  with:
    fetch-depth: 1
- run: git fetch origin ${{ github.base_ref }} --depth=1
```
Expected: the base commit is present; `git merge-base HEAD origin/${{ github.base_ref }}` prints a SHA.
4. Rerun the reviewdog job. Expected: reviewdog logs the files it is checking instead of the empty-diff error.

## Use this when
- reviewdog exits with a diff-is-empty error on a PR workflow
- The checkout uses the default shallow fetch
- An agent opened a draft PR before pushing any commits

## Not for this skill when
- reviewdog fails with a different error (auth, config, parser); this skill is only the empty-diff case
- The run is on a push to main, not a PR; there is no PR diff to compute by design
- The diff is empty because the linter found nothing; that is a clean run, not a failure

## Variant phrasings
- "reviewdog fail to get diff empty"
- "reviewdog action no diff found pull request"
- "reviewdog exits no output shallow checkout"

## Why it happens
reviewdog builds its change set by diffing the PR head against the base commit locally. A shallow checkout (the actions/checkout default) omits the base commit, so the diff computes to nothing. Draft PRs opened before the first push add a second cause: there are literally no commits to diff.

## Edge cases
- `fetch-depth: 0` on a huge monorepo is slow; prefer fetching just the base ref.
- reviewdog's `fail_on_error` still fails the job on empty diff in some configs; the fix is the checkout, not silencing the flag.
- If the workflow checks out the merge commit, make sure the base ref fetch matches `github.base_ref`, not the default branch name when the PR targets a release branch.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_f2QeUFo5OYOWf-mLzNJXqg
