Add experimental functionality for labelling PRs by their size

This commit is contained in:
Henry Mercer
2025-10-20 15:10:40 +01:00
parent d88a5540c3
commit 8c324fe288
2 changed files with 80 additions and 0 deletions

54
.github/sizeup.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
labeling:
applyCategoryLabels: true
categoryLabelPrefix: "size/"
commenting:
addCommentWhenScoreThresholdHasBeenExceeded: false
sizeup:
categories:
- name: extra small
lte: 10
label:
name: XS
description: Should be very easy to review
color: 3cbf00
- name: small
lte: 30
label:
name: S
description: Should be easy to review
color: 5d9801
- name: medium
lte: 100
label:
name: M
description: Should be of average difficulty to review
color: 7f7203
- name: large
lte: 500
label:
name: L
description: May be hard to review
color: a14c05
- name: extra large
label:
name: XL
description: May be very hard to review
color: c32607
- name: extra extra large
label:
name: XXL
description: May be extremely hard to review
color: e50009
ignoredFilePatterns:
- ".github/workflow/__*"
- "lib/**/*"
- "package-lock.json"
testFilePatterns:
- "**/*.test.ts"
scoring:
# This formula and the aliases below it are written in prefix notation.
# For an explanation of how this works, please see:
# https://github.com/lerebear/sizeup-core/blob/main/README.md#prefix-notation
formula: "- - + additions deletions comments whitespace"

26
.github/workflows/label-pr-size.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Label PRs by their size
on:
pull_request:
types:
- opened
- synchronize
- reopened
- edited
- ready_for_review
permissions:
contents: read
pull-requests: write
jobs:
sizeup:
name: Estimate reviewability
runs-on: ubuntu-latest
steps:
- name: Run sizeup
uses: lerebear/sizeup-action@b7beb3dd273e36039e16e48e7bc690c189e61951
with:
token: "${{ secrets.GITHUB_TOKEN }}"
configuration-file-path: ".github/sizeup.yml"