From 6d35f013030fcc115f0c134084f05caf6f60eb08 Mon Sep 17 00:00:00 2001 From: Leo Galambos Date: Mon, 20 Jul 2026 01:37:17 +0200 Subject: [PATCH] fix: retain only the 10 latest GitHub Pages builds --- .github/workflows/pages.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index cc7ba1c..ea67c07 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -275,11 +275,26 @@ jobs: - [Browse historical build reports](https://leogalambos.github.io/Radixor/builds/) EOF + # Retain only the 10 most recent numbered builds to stay within + # GitHub Pages capacity limits. The "latest" alias is kept separately. + mapfile -t EXPIRED_BUILDS < <( + find "${SITE_DIR}/builds" -mindepth 1 -maxdepth 1 -type d -printf '%P\n' \ + | grep -E '^[0-9]+$' \ + | sort -r -n \ + | tail -n +11 + ) + + for build in "${EXPIRED_BUILDS[@]}"; do + rm -rf "${SITE_DIR}/builds/${build}" + done + { echo "# Historical Build Reports" echo echo "The following build report sets are currently published on GitHub Pages." echo + echo "To stay within GitHub Pages capacity limits, only the 10 most recent build report sets are retained." + echo echo "| Build | Published | Link |" echo "|---:|---|---|"