mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-03 06:08:15 +00:00
53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
name: PR Size Check
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
pr-size:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: write
|
|
steps:
|
|
- uses: codelytv/pr-size-labeler@095a41fca88b8764fd9e008ad269bcdb82bb38b9 # v1
|
|
with:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
xs_label: "size/XS"
|
|
xs_max_size: 25
|
|
s_label: "size/S"
|
|
s_max_size: 100
|
|
m_label: "size/M"
|
|
m_max_size: 250
|
|
l_label: "size/L"
|
|
l_max_size: 500
|
|
xl_label: "size/XL"
|
|
fail_if_xl: false
|
|
files_to_ignore: |
|
|
uv.lock
|
|
*.lock
|
|
lib/crewai/src/crewai/cli/templates/**
|
|
**/*.json
|
|
**/test_durations/**
|
|
**/cassettes/**
|
|
|
|
python-diff-size:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Enforce Python diff size limit
|
|
env:
|
|
MAX: "1500"
|
|
run: |
|
|
base="origin/${{ github.base_ref }}"
|
|
# Sum added + deleted lines across changed .py files; skip binaries ("-").
|
|
total=$(git diff --numstat "$base...HEAD" -- '*.py' \
|
|
| awk '$1 != "-" && $2 != "-" { sum += $1 + $2 } END { print sum + 0 }')
|
|
echo "Python churn: $total lines (limit $MAX)"
|
|
if [ "$total" -gt "$MAX" ]; then
|
|
echo "::error::Python changes total $total lines, over the $MAX-line limit. Split into smaller PRs."
|
|
git diff --numstat "$base...HEAD" -- '*.py' | sort -rn
|
|
exit 1
|
|
fi |