GitHub Actions
Store the ping URL as a repository secret named CRONNUDGE_URL. The workflow below reports a start, runs the task, and reports success or failure even when the task fails.
name: Nightly backup
on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
jobs:
backup:
runs-on: ubuntu-latest
env:
CRONNUDGE_URL: ${{ secrets.CRONNUDGE_URL }}
steps:
- name: Tell CronNudge the job started
run: curl -fsS -m 10 --retry 3 "$CRONNUDGE_URL/start"
- name: Do the work
run: ./backup.sh
- name: Tell CronNudge how it finished
if: always()
run: |
if [ "${{ job.status }}" = "success" ]; then
curl -fsS -m 10 --retry 3 "$CRONNUDGE_URL"
else
curl -fsS -m 10 --retry 3 "$CRONNUDGE_URL/fail"
fi- Match the check’s cron expression and timezone to the schedule. GitHub schedules are UTC unless that schedule entry sets timezone. Paste the block at /tools/github-actions.
- A missing ping, including a runner that never starts, is what CronNudge is for. The /fail path covers a job that starts and then breaks.
- Do not echo the secret in logs. curl -fsS does not print the URL.
Longer guide: Schedule not running