Supabase keepalive #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Supabase keepalive | |
| on: | |
| schedule: | |
| - cron: '0 12 * * *' # every day at noon UTC | |
| workflow_dispatch: | |
| jobs: | |
| ping: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Ping Supabase | |
| run: | | |
| RESPONSE=$(curl -s -m 30 -w "\n%{http_code}" \ | |
| "${{ secrets.SUPABASE_URL }}/rest/v1/" \ | |
| -H "apikey: ${{ secrets.SUPABASE_ANON_KEY }}" \ | |
| -H "Authorization: Bearer ${{ secrets.SUPABASE_ANON_KEY }}") | |
| STATUS=$(echo "$RESPONSE" | tail -n1) | |
| BODY=$(echo "$RESPONSE" | head -n-1) | |
| echo "HTTP status: $STATUS" | |
| echo "Response body: $BODY" | |
| if [[ ! "$STATUS" =~ ^[0-9]+$ ]] || [ "$STATUS" -ge 500 ] || [ "$STATUS" -eq 0 ]; then | |
| echo "Ping failed — project may be paused or secrets missing" | |
| exit 1 | |
| fi | |
| echo "Ping succeeded" |