From 7fb9c33b72b6e1cec989dff14605c6d4f27de8ff Mon Sep 17 00:00:00 2001 From: Lucas Carlson Date: Thu, 8 Oct 2026 00:54:38 -0700 Subject: [PATCH] ci: read the Context7 error field with jq Same fix as review feedback on solid-objects-js#65. The too-early check matched the exact string "error":"too-early", so valid JSON with other spacing, such as {"error": "too-early"}, would fail the job instead of skipping. Read the field with jq. On four sample bodies, grep missed the spaced form and jq skipped it, and both still fail on another error and on a body that is not JSON. Against the live API the workflow script still exits 0 with the notice. --- .github/workflows/context7-refresh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/context7-refresh.yml b/.github/workflows/context7-refresh.yml index 05732b2..17d0057 100644 --- a/.github/workflows/context7-refresh.yml +++ b/.github/workflows/context7-refresh.yml @@ -33,7 +33,7 @@ jobs: if [ "$status" = "200" ]; then exit 0 fi - if [ "$status" = "400" ] && grep -q '"error":"too-early"' response.json; then + if [ "$status" = "400" ] && jq -e '.error == "too-early"' response.json > /dev/null; then echo "::notice::Context7 refreshed $LIBRARY_NAME recently, so it skipped this refresh." exit 0 fi