Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,20 @@ jobs:
--retry-all-errors https://classifier.dev/v1/health)
echo "$health"
echo "$health" | grep -q '"ok": true'
label=$(curl --fail --silent --show-error https://classifier.dev/spam,not+spam/Win+a+free+iPhone)
echo "classify -> $label"
test "$label" = "spam"
# The anonymous probe runs from a hosted runner, whose IP the free-traffic
# reputation gate may refuse (403 proxy_requires_payment). That is the
# Worker answering with its own gate, not a broken deploy, so it passes
# with a notice; every other non-200 fails. The body is always printed,
# so a failure here says what was answered rather than only that it was.
code=$(curl --silent --show-error -o classify.json -w '%{http_code}' -H 'accept: application/json' \
https://classifier.dev/spam,not+spam/Win+a+free+iPhone)
echo "classify -> HTTP $code"; cat classify.json; echo
case "$code" in
200) grep -Eq '"label": *"spam"' classify.json ;;
403) grep -Eq '"code": *"proxy_requires_payment"' classify.json &&
echo "::notice::the anonymous probe was refused by the reputation gate for this runner's IP; the Worker is live" ;;
*) echo "::error::anonymous classification answered HTTP $code"; exit 1 ;;
esac
- name: Check multidimensional classification end to end
env:
CLASSIFIER_BASE_URL: https://classifier.dev
Expand Down
Loading