From 02890c383b8ab746b5891118a8a500e4020907e8 Mon Sep 17 00:00:00 2001 From: Konstantin Androsov Date: Sun, 21 Jun 2026 13:52:02 +0200 Subject: [PATCH 1/2] Fail CI if repo size increases by >1MB without 'big changes' label --- .github/workflows/repo-sanity-checks.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/repo-sanity-checks.yaml b/.github/workflows/repo-sanity-checks.yaml index 1a98e09f5..476b57980 100644 --- a/.github/workflows/repo-sanity-checks.yaml +++ b/.github/workflows/repo-sanity-checks.yaml @@ -59,6 +59,8 @@ jobs: run: echo "size=$(du -sb .git/objects/pack | cut -f1)" >> $GITHUB_OUTPUT - name: Calculate and report delta + env: + HAS_BIG_CHANGES_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'big changes') }} run: | delta=$(( ${{ steps.size_after.outputs.size }} - ${{ steps.size_before.outputs.size }} )) delta_kb=$(( delta / 1024 )) @@ -66,6 +68,16 @@ jobs: echo "Size before: ${{ steps.size_before.outputs.size }} bytes" >> $GITHUB_STEP_SUMMARY echo "Size after: ${{ steps.size_after.outputs.size }} bytes" >> $GITHUB_STEP_SUMMARY echo "Repository size would increase by approximately $delta_kb KiB if this PR is squash merged." >> $GITHUB_STEP_SUMMARY + + MAX_THR_KB=1024 + if [ "$delta_kb" -gt "$MAX_THR_KB" ]; then + if [ "$HAS_BIG_CHANGES_LABEL" = "true" ]; then + echo "Size increase is over threshold ($MAX_THR_KB KiB), but PR has 'big changes' label. Proceeding." >> $GITHUB_STEP_SUMMARY + else + echo "::error::Repository size increase ($delta_kb KiB) exceeds threshold of $MAX_THR_KB KiB. Please use Git LFS for large files or add the 'big changes' label to this PR if the size increase is expected." + exit 1 + fi + fi check-for-binary-files: runs-on: ubuntu-latest From cff30c88133baa280905ea8a8a5fbdaec9ced07e Mon Sep 17 00:00:00 2001 From: Konstantin Androsov Date: Sun, 21 Jun 2026 13:55:37 +0200 Subject: [PATCH 2/2] Fix trailing spaces in repo-sanity-checks.yaml --- .github/workflows/repo-sanity-checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/repo-sanity-checks.yaml b/.github/workflows/repo-sanity-checks.yaml index 476b57980..629c1604a 100644 --- a/.github/workflows/repo-sanity-checks.yaml +++ b/.github/workflows/repo-sanity-checks.yaml @@ -68,7 +68,7 @@ jobs: echo "Size before: ${{ steps.size_before.outputs.size }} bytes" >> $GITHUB_STEP_SUMMARY echo "Size after: ${{ steps.size_after.outputs.size }} bytes" >> $GITHUB_STEP_SUMMARY echo "Repository size would increase by approximately $delta_kb KiB if this PR is squash merged." >> $GITHUB_STEP_SUMMARY - + MAX_THR_KB=1024 if [ "$delta_kb" -gt "$MAX_THR_KB" ]; then if [ "$HAS_BIG_CHANGES_LABEL" = "true" ]; then