Fix CI: make Bitnami MinIO Dockerfile SHA lookup resilient (#10049)
Run the E2E test on kind / get-go-version (push) Failing after 1m0s
Run the E2E test on kind / setup-test-matrix (push) Successful in 4s
Run the E2E test on kind / build (push) Has been skipped
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Successful in 13s
Main CI / Build (push) Failing after 28s

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 <tkaovila@redhat.com>
This commit is contained in:
Tiger Kaovilai
2026-07-22 10:14:18 -04:00
committed by GitHub
parent 4be131b3f9
commit 7ecf06d190
+22 -2
View File
@@ -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