Skip to content

fix: improved error handling in controllers and scholarship browser, … #83

fix: improved error handling in controllers and scholarship browser, …

fix: improved error handling in controllers and scholarship browser, … #83

Workflow file for this run

# Tanglaw — Post-Deploy Verification
# After Render deploys, verifies the backend is healthy and seeded.
# Database migrations and seeding happen automatically on Render via
# backend/start.sh (Render supports IPv6; GitHub Actions does not).
#
# On first deploy, Render will take ~2-3 minutes to build + seed.
# This workflow waits for that and checks the result.
name: Post-Deploy Check
on:
push:
branches: [main]
workflow_dispatch:
jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Wait for Render deploy to finish
run: |
echo "Waiting for Render to deploy and seed the database..."
for i in $(seq 1 30); do
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
--connect-timeout 5 https://tanglaw-api.onrender.com/api/health 2>/dev/null || echo "000")
if [ "$STATUS" = "200" ]; then
echo "✅ Render is healthy!"
exit 0
fi
echo " Attempt $i/30 — status $STATUS, waiting 10s..."
sleep 10
done
echo "❌ Render did not become healthy within 5 minutes."
exit 1
- name: Verify the signup endpoint is responding
run: |
echo "Testing signup endpoint..."
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
https://tanglaw-api.onrender.com/api/auth/signup \
-H "Content-Type: application/json" \
-H "Origin: https://tanglaw-project.vercel.app" \
-d '{"fullName":"","email":"bad-email","password":"x"}' 2>/dev/null)
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
BODY=$(echo "$RESPONSE" | head -n -1)
echo "Status: $HTTP_CODE"
echo "Body: $BODY"
if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "400" ] || [ "$HTTP_CODE" = "409" ]; then
echo "✅ Signup endpoint is working!"
exit 0
else
echo "❌ Signup endpoint returned unexpected status $HTTP_CODE"
exit 1
fi