This repository was archived by the owner on Jul 4, 2026. It is now read-only.
Trigger Supabase Cleanup API #154
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: Trigger Supabase Cleanup API | |
| on: | |
| schedule: | |
| # Run on the 1st and 15th of each month at 2 AM UTC | |
| - cron: "0 2 1,15 * *" | |
| workflow_dispatch: # Allows manual triggering | |
| jobs: | |
| trigger_cleanup: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Call Supabase Cleanup Endpoint | |
| env: | |
| # The base URL of your deployed backend on Vercel | |
| VERCEL_BACKEND_URL: ${{ secrets.VERCEL_BACKEND_URL }} | |
| CLEANUP_CRON_SECRET: ${{ secrets.SUPABASE_CLEANUP_CRON_SECRET }} | |
| run: | | |
| if [ -z "$VERCEL_BACKEND_URL" ]; then | |
| echo "Error: VERCEL_BACKEND_URL secret is not set." | |
| exit 1 | |
| fi | |
| if [ -z "$CLEANUP_CRON_SECRET" ]; then | |
| echo "Error: SUPABASE_CLEANUP_CRON_SECRET secret is not set." | |
| exit 1 | |
| fi | |
| echo "Triggering Supabase cleanup at $VERCEL_BACKEND_URL/api/clean-supabase/trigger" | |
| curl --fail --show-error --silent -X POST \ | |
| "$VERCEL_BACKEND_URL/api/clean-supabase/trigger" \ | |
| -H "x-cron-secret: $CLEANUP_CRON_SECRET" |