A GitHub Action that automatically labels pull requests based on their size (additions + deletions).
- Automatically calculates PR size from additions and deletions
- Intelligently updates labels only when size category changes
- Supports size categories: XS, S, M, L, XL, XXL
- Works with any repository
- Prevents unnecessary label updates for better UX
| Size | Lines Changed | Label |
|---|---|---|
| 0-35 | Small changes | size: XS |
| 36-60 | Small changes | size: S |
| 61-120 | Medium changes | size: M |
| 121-240 | Large changes | size: L |
| 241-600 | Extra large changes | size: XL |
| 600+ | Very large changes | size: XXL |
name: PR Size Label
on:
pull_request_target:
types: [opened, synchronize]
permissions:
pull-requests: write
issues: write
jobs:
size-label:
runs-on: ubuntu-latest
steps:
- name: Label PR by size
uses: conforma/[email protected]name: PR Size Label
on:
pull_request_target:
types: [opened, synchronize]
permissions:
pull-requests: write
issues: write
jobs:
size-label:
runs-on: ubuntu-latest
steps:
- name: Label PR by size
uses: conforma/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}| Input | Description | Required | Default |
|---|---|---|---|
token |
GitHub token for API access | Yes | ${{ github.token }} |
-
Install dependencies:
npm install
-
Build the action:
npm run build
-
Test locally (you'll need to set up a test repository)
Apache 2.0