Skip to content

azwandi/supabase-pinger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Supabase Pinger

Keeps Supabase free-tier projects alive by pinging them every 3 days via GitHub Actions.

Supabase pauses free-tier projects after 7 days of inactivity. This repo queries each project's database every 3 days, resetting the inactivity timer.


Setup

1. Find your credentials

For each Supabase project you want to keep alive:

  1. Open the Supabase Dashboard
  2. Select your project
  3. Go to Settings > API
  4. Copy:
    • Project URL (e.g. https://abcdefgh.supabase.co)
    • anon / public key under "Project API keys"

2. Build the JSON secret

Using secrets-template.json as a guide, create a JSON array with one entry per project:

[
  { "name": "my-project-prod", "url": "https://abcdefgh.supabase.co", "key": "eyJ...", "table": "posts" },
  { "name": "another-project", "url": "https://qrstuvwx.supabase.co", "key": "eyJ..." }
]
  • name — a human-readable label used only in log output
  • url — Project URL from Settings > API
  • keyanon (public) key from Settings > API
  • table (recommended) — any table readable by the anon key; triggers SELECT * FROM table LIMIT 1, which is a guaranteed database read. Without this field, the workflow falls back to hitting the API root, which may not reliably count as activity.

You can add as many projects (across as many Supabase accounts) as you like.

3. Add the secret to GitHub

  1. In your GitHub repo, go to Settings > Secrets and variables > Actions
  2. Click New repository secret
  3. Name: SUPABASE_PROJECTS
  4. Value: your JSON array from step 2
  5. Click Add secret

4. Enable Actions (if forked)

If you forked this repo, GitHub disables Actions by default.

  1. Go to the Actions tab
  2. Click I understand my workflows, go ahead and enable them

5. Verify it works

Trigger a manual run to confirm everything is configured correctly:

  1. Go to Actions tab
  2. Select Keep Supabase Projects Alive
  3. Click Run workflow > Run workflow
  4. Watch the logs — each project should show [OK] with an HTTP status

Schedule

The workflow runs automatically at midnight UTC every 3 days (0 0 */3 * *).

No further action needed after setup.


Log output

Pinging: my-project-prod — querying table 'posts'
[OK] my-project-prod — HTTP 200
Pinging: another-project — hitting API root (consider adding a 'table' field for a guaranteed DB read)
[OK] another-project — HTTP 200
All projects pinged successfully.

If a project fails:

[FAIL] another-project — curl exit 22, HTTP 401

GitHub will send a failure email notification if any project fails to ping.


Security notes

  • Only the anon (public) key is used — it has the same access as an anonymous browser visitor.
  • The secret is never printed in logs.
  • No writes are made to your database.

About

Automatically keeps Supabase free-tier projects alive by querying them every 3 days via GitHub Actions, preventing inactivity-based pauses.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors