GitHub Actions scheduled workflows (on: schedule) run silently. If a workflow is disabled, the schedule is misconfigured, or GitHub's scheduler has a hiccup, you won't know — unless you have a heartbeat. Alert24 heartbeat checks detect when your scheduled workflows stop firing.
Before you start
- In Alert24, go to Monitoring → Add check → Heartbeat
- Name it after your workflow (e.g., "Nightly report workflow")
- Set Expected interval to match your cron schedule, plus some buffer:
- Hourly → 3600 seconds
- Daily → 86400 seconds
- Set Grace period to at least 15 minutes (GitHub's scheduler can run up to 15 min late)
- Save and copy the heartbeat URL
Add the ping as the last step
# .github/workflows/nightly-report.yml
name: Nightly report
on:
schedule:
- cron: '0 3 * * *' # 3am UTC daily
jobs:
run-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate report
run: python scripts/generate_report.py
- name: Upload to S3
run: aws s3 sync ./reports s3://my-bucket/reports/
- name: Ping Alert24 heartbeat
if: success()
run: curl -fsS --retry 3 ${{ secrets.ALERT24_HEARTBEAT_URL }}
Store your heartbeat URL as a GitHub Actions secret (ALERT24_HEARTBEAT_URL) rather than embedding the token directly.
Why use a secret for the URL
The heartbeat URL contains a token that identifies your check. While the token only grants the ability to record heartbeats (not read or write anything else), keeping it in a secret prevents it from appearing in public workflow logs.
Monitor multiple workflows independently
Each scheduled workflow should have its own Alert24 heartbeat check:
# workflow-a.yml
- name: Ping heartbeat
if: success()
run: curl -fsS --retry 3 ${{ secrets.ALERT24_HB_WORKFLOW_A }}
# workflow-b.yml
- name: Ping heartbeat
if: success()
run: curl -fsS --retry 3 ${{ secrets.ALERT24_HB_WORKFLOW_B }}
Tips
if: success(): This ensures the heartbeat only fires when all previous steps pass. A failed step → no ping → Alert24 fires an incident.- GitHub's scheduler: GitHub schedules workflows with up to 15-minute delay during peak times. Set your grace period to at least 15 minutes to avoid false incidents.
- Disabled repositories: If a GitHub repository is archived, scheduled workflows stop running. Alert24 will catch this after one missed interval.
- Workflow run limits: GitHub's free tier has monthly workflow run limits. If you hit the limit, workflows stop and Alert24 fires an incident — which is exactly the behavior you want.