Skip to content

fix/lib-jitsi-meet-v14 #526

fix/lib-jitsi-meet-v14

fix/lib-jitsi-meet-v14 #526

Workflow file for this run

name: PR Size Checker
on: pull_request
jobs:
check_pr_size:
name: Check PR size doesn't break set limit (excluding tests)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Calculate changed lines excluding tests
id: count_lines
run: |
MAX_LINES=500
EXCLUDE_PATTERN='(_test\.go$|\.spec\.js$|\.test\.ts$|^tests?/|/test/|/fixtures/|AssemblyInfo\.cs$|\.snap$)'
BASE_REF="origin/${{ github.base_ref }}"
CURRENT_REF="${{ github.sha }}"
echo "Comparing $BASE_REF...$CURRENT_REF"
echo "Excluding files matching pattern: $EXCLUDE_PATTERN"
TOTAL_LINES=$(git diff --numstat $BASE_REF...$CURRENT_REF | grep -vE "$EXCLUDE_PATTERN" | awk '{ added+=$1; deleted+=$2 } END { print added+deleted }')
if [[ -z "$TOTAL_LINES" ]]; then
TOTAL_LINES=0
fi
echo "Total changed lines (excluding tests): $TOTAL_LINES"
echo "Maximum allowed lines: $MAX_LINES"
echo "total_lines=$TOTAL_LINES" >> $GITHUB_OUTPUT
if [[ $TOTAL_LINES -gt $MAX_LINES ]]; then
echo "Error: PR exceeds the maximum allowed line changes ($MAX_LINES) after excluding test files."
exit 1
else
echo "PR size is within the allowed limit."
fi