caelum0x b009b496ba feat: setup/list/uninstall cron commands, publish as supabase-stay-awake
supabase-keepalive and supabase-keep-alive were both already taken/blocked
on npm (an unrelated package and npm's publish-time name-similarity filter),
so this ships on the registry as supabase-stay-awake instead.

Adds the one-command scheduled-ping setup the CLI was missing: `setup`
copies itself to ~/.supabase-stay-awake/ping.js and installs a daily user
crontab line (zero signup to us, no GitHub); `list`/`uninstall` manage it;
falls back to printing the line (never hangs) if crontab can't be written.

Also points every README/CLI example at the published package instead of
the npx --yes git+... form, and fixes the stale git.ereboslab.com links to
rithub.dev (the domain itself already 301s there).

Published and verified live: npm install in a clean dir, help/setup/list/
uninstall/one-off-ping all run correctly against the real registry.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-26 17:05:24 +03:00

35 lines
1.2 KiB
YAML

# The full script: REST root check, table read or rpc call, retries, job summary, and the
# three early warnings (last success too old, weekly cron, GitHub about to disable the schedule).
#
# One-time setup, in your repository:
# mkdir -p .github
# curl -fsSL -o .github/keepalive.sh \
# https://rithub.dev/caelum0x/supabase-keep-alive-action/raw/tag/v1/keepalive.sh
# git add .github/keepalive.sh && git commit -m "add supabase keep-alive script"
#
# The script then lives in your repository, so the job depends on nothing outside it.
# Repository secrets: SUPABASE_URL and SUPABASE_ANON_KEY.
name: Keep Supabase alive
on:
schedule:
- cron: "17 6 * * *" # daily, 06:17 UTC; avoid :00, GitHub's busiest minute
workflow_dispatch:
permissions:
contents: read
actions: read # lets the script read this workflow's previous runs
jobs:
ping:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Keep-alive ping
env:
INPUT_URL: ${{ secrets.SUPABASE_URL }}
INPUT_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
INPUT_TABLE: keepalive # or INPUT_RPC: keepalive_ping
INPUT_GITHUB_TOKEN: ${{ github.token }}
run: bash .github/keepalive.sh