close
Skip to content

conforma/pr-size-label-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

PR Size Label Action

A GitHub Action that automatically labels pull requests based on their size (additions + deletions).

Features

  • 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 Categories

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

Usage

Basic Usage

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/pr-size-label-action@v1.0.0

With Custom Token

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/pr-size-label-action@v1.0.0
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

Inputs

Input Description Required Default
token GitHub token for API access Yes ${{ github.token }}

Development

  1. Install dependencies:

    npm install
  2. Build the action:

    npm run build
  3. Test locally (you'll need to set up a test repository)

License

Apache 2.0

About

GitHub Action to automatically label PRs based on size

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors