Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

ci: add PR size labeler action

Tin30a7eb0426ca
diff --git a/.github/pull-request-size.yml b/.github/pull-request-size.yml
new file mode 100644
index 000000000..c5e92c2b3
--- /dev/null
+++ b/.github/pull-request-size.yml
@@ -0,0 +1,31 @@
+# Exclude dependency and skill lockfiles from both line and file counts.
+exclude_files:
+ - pnpm-lock.yaml
+ - package-lock.json
+ - skills-lock.json
+
+# Thresholds are inclusive. The larger size from line and file counts wins.
+# Keep entries ordered from smallest to largest; xl also covers larger PRs.
+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"]
+
+added_lines_only: false
diff --git a/.github/workflows/pr-size-labeler.yml b/.github/workflows/pr-size-labeler.yml
new file mode 100644
index 000000000..b33c2db1a
--- /dev/null
+++ b/.github/workflows/pr-size-labeler.yml
@@ -0,0 +1,35 @@
+name: PR Size Labeler
+
+on:
+ pull_request_target:
+ types: [opened, synchronize, reopened]
+
+permissions:
+ contents: read
+ pull-requests: write
+
+concurrency:
+ group: pr-size-labeler-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+
+jobs:
+ label:
+ runs-on: ubuntu-24.04
+ timeout-minutes: 5
+ steps:
+ # Only read trusted base-branch configuration, including for fork PRs.
+ - name: Checkout size configuration
+ uses: actions/[email protected]
+ with:
+ ref: ${{ github.event.pull_request.base.sha }}
+ persist-credentials: false
+ sparse-checkout: .github/pull-request-size.yml
+ sparse-checkout-cone-mode: false
+
+ - name: Label PR based on size
+ uses: cbrgm/pr-size-labeler-action@6b70abfe1f75f6f35ca24731f6d25fb7251b6127 # v1.3.13
+ 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