From 7ecf06d190fc6c6a1d07bc72d770d4dd30997359 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Wed, 22 Jul 2026 10:14:18 -0400 Subject: [PATCH] Fix CI: make Bitnami MinIO Dockerfile SHA lookup resilient (#10049) curl piped straight into jq with no error check; a non-JSON or failed HTTP response (rate limit, transient API error) broke jq with an opaque parse error. Add --fail-with-body, retries, and validate the parsed SHA before continuing. Fixes #10048 Signed-off-by: Tiger Kaovilai --- .github/workflows/e2e-test-kind.yaml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-test-kind.yaml b/.github/workflows/e2e-test-kind.yaml index fc77cb4d3..42dcaa707 100644 --- a/.github/workflows/e2e-test-kind.yaml +++ b/.github/workflows/e2e-test-kind.yaml @@ -62,8 +62,28 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - DOCKERFILE_SHA=$(curl -s -H "Authorization: Bearer $GH_TOKEN" https://api.github.com/repos/bitnami/containers/commits?path=bitnami/minio/2026/debian-12/Dockerfile\&per_page=1 | jq -r '.[0].sha') - echo "dockerfile_sha=${DOCKERFILE_SHA}" >> $GITHUB_OUTPUT + set -euo pipefail + + url="https://api.github.com/repos/bitnami/containers/commits?path=bitnami/minio/2026/debian-12/Dockerfile&per_page=1" + + response="$(curl --fail-with-body -sS \ + --retry 5 \ + --retry-delay 2 \ + --retry-all-errors \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${GH_TOKEN}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "$url")" + + DOCKERFILE_SHA="$(echo "$response" | jq -r '.[0].sha // empty')" + + if [ -z "$DOCKERFILE_SHA" ]; then + echo "Failed to resolve Bitnami MinIO Dockerfile SHA from GitHub API response" + echo "$response" + exit 1 + fi + + echo "dockerfile_sha=${DOCKERFILE_SHA}" >> "$GITHUB_OUTPUT" - name: Cache MinIO Image uses: actions/cache@v4 id: minio-cache