From aed17a26e196bddb7a9d9d0953c5f0e161f0295c Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Thu, 2 Jul 2026 13:54:52 +0200 Subject: [PATCH] ci: fix preview-cleanup deployment query (HTTP 400) and move CI off Node 20 The Docs preview cleanup workflow listed deployments with per_page=100, which the Cloudflare Pages deployments endpoint rejects with HTTP 400, so the cleanup step failed on PR close. Page through deployments with the default page size instead (env=preview&page=N until an empty page), collecting this branch's ids. Also bump actions/checkout v4->v5 and azure/setup-helm v4->v5 across the CI workflows to move off the deprecated Node 20 runtime. docs.yml is intentionally left untouched: the Astro/Starlight migration PR replaces it and already pins checkout v5. --- .github/workflows/build-image.yaml | 2 +- .github/workflows/docs-preview-cleanup.yml | 16 ++++++++++++++-- .github/workflows/lint.yaml | 4 ++-- .github/workflows/release.yaml | 4 ++-- .github/workflows/test-integration.yaml | 6 +++--- .github/workflows/test.yaml | 4 ++-- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index aa13b9e..f584a82 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -18,7 +18,7 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Log in to GHCR uses: docker/login-action@v3 diff --git a/.github/workflows/docs-preview-cleanup.yml b/.github/workflows/docs-preview-cleanup.yml index 7e8a80a..5ed8f18 100644 --- a/.github/workflows/docs-preview-cleanup.yml +++ b/.github/workflows/docs-preview-cleanup.yml @@ -30,8 +30,20 @@ jobs: run: | set -euo pipefail base="https://api.cloudflare.com/client/v4/accounts/${CF_ACCOUNT_ID}/pages/projects/${CF_PROJECT}/deployments" - ids=$(curl -fsS -H "Authorization: Bearer ${CF_API_TOKEN}" "${base}?env=preview&per_page=100" \ - | jq -r --arg b "$BRANCH" '.result[] | select(.deployment_trigger.metadata.branch == $b) | .id') + # Collect this branch's preview deployment ids. Page through results: + # the endpoint rejects an oversized per_page with HTTP 400, so use the + # default page size and paginate until a page comes back empty. + ids="" + page=1 + while :; do + resp=$(curl -fsS -H "Authorization: Bearer ${CF_API_TOKEN}" "${base}?env=preview&page=${page}") + count=$(printf '%s' "$resp" | jq '.result | length') + [ "$count" -eq 0 ] && break + match=$(printf '%s' "$resp" | jq -r --arg b "$BRANCH" '.result[] | select(.deployment_trigger.metadata.branch == $b) | .id') + [ -n "$match" ] && ids="${ids}${match}"$'\n' + page=$((page + 1)) + [ "$page" -gt 100 ] && break + done if [ -z "$ids" ]; then echo "No preview deployments found for branch '$BRANCH'." exit 0 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b7642b8..b99646c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -10,10 +10,10 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Helm - uses: azure/setup-helm@v4 + uses: azure/setup-helm@v5 - name: Install kubeconform run: | diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 64976d0..5e883eb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 @@ -32,7 +32,7 @@ jobs: git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - name: Set up Helm - uses: azure/setup-helm@v4 + uses: azure/setup-helm@v5 - name: Update dependencies run: helm dependency update ${{ inputs.chart_path }} || true diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index 8058c38..259d906 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -19,10 +19,10 @@ jobs: OPERATOR_REF: v0.1.0-alpha.19 steps: - name: Checkout software-pack-template - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Checkout nebari-operator (for dev/scripts) - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: nebari-dev/nebari-operator ref: ${{ env.OPERATOR_REF }} @@ -34,7 +34,7 @@ jobs: cluster_name: pack-integration - name: Set up Helm - uses: azure/setup-helm@v4 + uses: azure/setup-helm@v5 # ============================================================ # Infrastructure: MetalLB diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index be15f9c..5cf418c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,7 +10,7 @@ jobs: integration: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Create kind cluster uses: helm/kind-action@v1 @@ -18,7 +18,7 @@ jobs: cluster_name: pack-test - name: Set up Helm - uses: azure/setup-helm@v4 + uses: azure/setup-helm@v5 # Test vanilla YAML example - name: Apply vanilla-yaml manifests