ci: auto-label PRs by size via cbrgm/pr-size-labeler-action (#1101)
Adds a GitHub Actions workflow and config that labels every PR with size/xs..size/xl based on files changed and lines added, so reviewers can see at a glance how big a PR is. Lock files and generated/vendored paths are excluded, and deletions aren't counted so refactors that remove code aren't over-penalized. Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
parent
39364f975f
commit
b96dc93d72
|
|
@ -0,0 +1,50 @@
|
|||
# Configuration for cbrgm/pr-size-labeler-action
|
||||
# See: https://github.com/cbrgm/pr-size-labeler-action
|
||||
#
|
||||
# A PR gets the smallest label whose `diff` and `files` thresholds both fit.
|
||||
# Generated/lock/vendored files are excluded so they don't dominate the size calculation.
|
||||
|
||||
exclude_files:
|
||||
- "**/pnpm-lock.yaml"
|
||||
- "**/package-lock.json"
|
||||
- "**/yarn.lock"
|
||||
- "**/*.lock"
|
||||
- "**/*.snap"
|
||||
- "**/dist/**"
|
||||
- "**/build/**"
|
||||
- "**/node_modules/**"
|
||||
- "**/vendor/**"
|
||||
- "**/*.min.js"
|
||||
- "**/*.min.css"
|
||||
- "**/*.map"
|
||||
- "**/*.generated.*"
|
||||
- "**/generated/**"
|
||||
|
||||
label_configs:
|
||||
- size: xs
|
||||
diff: 25
|
||||
files: 1
|
||||
labels: ["size/xs"]
|
||||
|
||||
- size: s
|
||||
diff: 150
|
||||
files: 10
|
||||
labels: ["size/s"]
|
||||
|
||||
- size: m
|
||||
diff: 600
|
||||
files: 25
|
||||
labels: ["size/m"]
|
||||
|
||||
- size: l
|
||||
diff: 2500
|
||||
files: 50
|
||||
labels: ["size/l"]
|
||||
|
||||
- size: xl
|
||||
diff: 5000
|
||||
files: 100
|
||||
labels: ["size/xl"]
|
||||
|
||||
# Count only added lines (ignore deletions) so large refactors/removals aren't over-penalized.
|
||||
added_lines_only: true
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
name: PR Size Labeler
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
- edited
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
label-pr-size:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Label PR based on size
|
||||
uses: cbrgm/pr-size-labeler-action@v1.3.7
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github_repository: ${{ github.repository }}
|
||||
github_pr_number: ${{ github.event.pull_request.number }}
|
||||
config_file_path: .github/pull-request-size.yml
|
||||
Loading…
Reference in New Issue