Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/pages-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,15 @@ jobs:

# Paginate through all deployments for this branch
# Note: Cloudflare prevents deleting the most recent deployment per project — that one will remain
# Cloudflare Pages API rejects per_page=100 with page param; explicitly use documented default page size (25)
echo "Fetching deployments for branch ${BRANCH}..."
PER_PAGE=25
PAGE=1
DEPLOYMENTS=""
while :; do
CURL_EXIT=0
RESPONSE=$(curl -s -w "\n%{http_code}" \
"${API_BASE}?per_page=100&page=${PAGE}" \
"${API_BASE}?per_page=${PER_PAGE}&page=${PAGE}" \
-H "Authorization: Bearer ${CLOUDFLARE_API_TOKEN}") || CURL_EXIT=$?
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | sed '$d')
Expand Down Expand Up @@ -302,7 +304,7 @@ jobs:
fi

PAGE_COUNT=$(echo "$BODY" | jq -r '.result | length')
[ "$PAGE_COUNT" -lt 100 ] && break
[ "$PAGE_COUNT" -lt "$PER_PAGE" ] && break
PAGE=$((PAGE + 1))
done

Expand Down
Loading