Ping Supabase to Prevent Pausing #22
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: Ping Supabase to Prevent Pausing | |
| on: | |
| schedule: | |
| - cron: "0 9 * * 1,4" | |
| workflow_dispatch: | |
| jobs: | |
| ping: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Ping Supabase via PostgREST | |
| env: | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.ROLE_KEY }} | |
| run: | | |
| response=$(curl -s \ | |
| -X GET "${SUPABASE_URL}/rest/v1/" \ | |
| -H "apikey: ${SUPABASE_SERVICE_ROLE_KEY}" \ | |
| -H "Authorization: Bearer ${SUPABASE_SERVICE_ROLE_KEY}") | |
| if [ -z "$response" ]; then | |
| echo "Error: empty response when pinging." >&2 | |
| exit 1 | |
| fi | |
| echo "Successful ping: $response" |