Shopify / lighthouse-ci-action

MIT License
100 stars 50 forks source link

Bubble API errors #5

Closed charlespwd closed 3 years ago

charlespwd commented 3 years ago

The following command will return null if the API response returns an error.

curl -s -X GET \
  -u $username:$password \
  "$host/admin/api/2021-04/products.json?published_status=published&limit=1" \
  | jq -r '.products[0].handle'

An error API response would look like this:

{"errors":"[API] This action requires merchant approval for read_products scope."}

We should exit 1 with "jq '.errors'" as message instead.