Skip to content

Commit

Permalink
tools: Handle wporg error response in stable-tag.sh (#37162)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
anomiex authored May 1, 2024
1 parent 66682e5 commit dbac1a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/stable-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit dbac1a1

Please sign in to comment.