From dbac1a1dd1ab7a9cc547d64bcbbeae91c4441767 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 1 May 2024 13:58:29 -0400 Subject: [PATCH] tools: Handle wporg error response in stable-tag.sh (#37162) If the WordPress.org plugin API returns an error, we should report that and exit instead of trying to continue processing only to fail with something cryptic later on. --- tools/stable-tag.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/stable-tag.sh b/tools/stable-tag.sh index 74362e1efcf9b..43208a29d91ab 100755 --- a/tools/stable-tag.sh +++ b/tools/stable-tag.sh @@ -84,6 +84,9 @@ JSON=$(curl -s "https://api.wordpress.org/plugins/info/1.0/$WPSLUG.json") if ! jq -e '.' <<<"$JSON" &>/dev/null; then die "Failed to retrieve JSON data from https://api.wordpress.org/plugins/info/1.0/$WPSLUG.json" fi +if jq -e '.error' <<<"$JSON" &>/dev/null; then + die "WordPress.org plugin API returned an error when querying $WPSLUG: $( jq -r '.error' <<<"$JSON" )" +fi # Current stable version CURRENT_STABLE_VERSION=$(jq -r .version <<<"$JSON")