From e55cf6ecba4d49e3d3090f0ae729a0cd339c7300 Mon Sep 17 00:00:00 2001 From: Christopher Albert Date: Fri, 13 Nov 2026 06:43:37 +0100 Subject: [PATCH] Fetch only the commit graph of a fork's parent --- .github/workflows/repo-hygiene.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/repo-hygiene.yml b/.github/workflows/repo-hygiene.yml index 6f45c9a..236b4d1 100644 --- a/.github/workflows/repo-hygiene.yml +++ b/.github/workflows/repo-hygiene.yml @@ -47,7 +47,10 @@ jobs: -H 'Accept: application/vnd.github+json' "https://api.github.com/repos/$REPOSITORY" | python3 -c 'import json, sys; print((json.load(sys.stdin).get("parent") or {}).get("full_name", ""))') if [ -n "$parent" ]; then - git fetch --no-tags "https://github.com/$parent.git" '+refs/heads/*:refs/upstream/*' + # Only the parent's commit graph is needed to exclude its commits; + # a full fetch of a large parent fills the runner disk. + git remote add upstream "https://github.com/$parent.git" + git -c gc.auto=0 fetch --no-tags --filter=tree:0 upstream '+refs/heads/*:refs/upstream/*' fi - uses: actions/checkout@v6 with: