From 96322177b321a643a9a9d5e2da16fe482b6b4b45 Mon Sep 17 00:00:00 2001 From: Victor Vogel Date: Thu, 22 Oct 2026 06:00:04 -0500 Subject: [PATCH] perf(ci): skip file contents when sizing pull requests The Label PR size job checks out the whole repository with fetch-depth 0, which downloads every blob on every branch and writes about 28,000 files, then only runs git diff --numstat between two commits. A sparse checkout of .github/ makes actions/checkout fetch with --filter=blob:none. The job keeps full commit history for the merge base, and git diff fetches only the blobs of the files the pull request changes. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/pr-size.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pr-size.yml b/.github/workflows/pr-size.yml index af557dff62df8..9d3408e2a752f 100644 --- a/.github/workflows/pr-size.yml +++ b/.github/workflows/pr-size.yml @@ -127,10 +127,14 @@ jobs: # This pull_request_target job may fetch untrusted PR commits only as passive # git data. Do not add dependency installs, build/test scripts, or cache # actions here; use pull_request plus workflow_run for that pattern instead. + # Sizing reads git history, not files. sparse-checkout makes actions/checkout + # fetch with --filter=blob:none, and git diff fetches only the changed blobs. - name: Checkout base repository uses: actions/checkout@v4 with: fetch-depth: 0 + sparse-checkout: /.github/ + sparse-checkout-cone-mode: false - name: Sync PR size label uses: actions/github-script@v8 env: