PR Size Detection

The Problem

The 3,000-line PR.

We’ve all seen it. No one wants to review it. It sits for days. Then gets approved with a “LGTM 👍” because everyone’s too busy to actually read it.

This is how technical debt accumulates and bugs slip through.

The Solution

lazyPR calculates PR size and warns (or blocks) based on configurable thresholds.

Default thresholds:

Both are fully configurable or can be disabled entirely.


Usage

Configure size thresholds in your workflow:

- uses: elvis-ndubuisi/lazypr@v1
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    api_key: ${{ secrets.OPENAI_API_KEY }}
    pr_size_warning: "500"   # Warn if exceeded (0 to disable)
    pr_size_block: "2000"    # Block if exceeded (0 to disable)

Configuration Options

pr_size_warning (optional, default: 500)

pr_size_block (optional, default: 2000)


Size Metrics

lazyPR tracks:

MetricDescription
Total LinesAdditions + deletions
Files ChangedNumber of modified files
AdditionsNew lines of code
DeletionsRemoved lines of code

Example output:

⚠️ PR Size Warning: 850 lines changed (exceeds 500 line threshold by 70%)

Consider splitting this PR into smaller, more focused changes for better review.

Template Integration

Access size metrics in custom templates:

### 📊 PR Size
- **Total:** {{prSizeLines}} lines
- **Files:** {{prSizeFiles}} changed
- **Additions:** {{prSizeAdditions}}
- **Deletions:** {{prSizeDeletions}}

{{prSizeMetrics}}

Available placeholders:


Key Benefits


Best Practices

Recommended thresholds:

When to disable:


Small PRs, better reviews. See user guide for more quality features.