GitHub Actions
Know when a scheduled workflow stops running, not just when it fails.
GitHub tells you when a workflow fails. It says nothing when a scheduled workflow stops running, which happens when a public repository goes 60 days without activity, when the schedule is not on the default branch, when a run is dropped at a busy hour, or when an edit removes the schedule block. A heartbeat closes that gap: the workflow pings Vivere at the end of each run, and Vivere alerts when a ping is overdue.
The short way: the action
Vivere ping is on the GitHub Marketplace. It is one composite step that calls curl, with no Node bundle and no Docker image to pull, and it accepts GitHub's own job.status values.
- uses: nicholasbergesen/vivere-ping-action@v1
if: always()
with:
url: ${{ secrets.VIVERE_PING_URL }}
status: ${{ job.status }}
Add a step with status: start at the beginning of the job and Vivere also records how long each run took. Source and every option: nicholasbergesen/vivere-ping-action (MIT).
The explicit way: curl
Store the ping URL as a repository secret named VIVERE_PING_URL, then add a final step that always runs:
name: nightly-report
on:
schedule:
- cron: "17 3 * * *"
workflow_dispatch:
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -fsS -m 10 --retry 3 "${{ secrets.VIVERE_PING_URL }}/start"
- name: Build the report
run: ./scripts/report.sh
- name: Report result to Vivere
if: always()
run: |
code=0; [ "${{ job.status }}" = "success" ] || code=1
curl -fsS -m 10 --retry 3 -X POST --data-binary "job ${{ job.status }} run ${{ github.run_id }}" "${{ secrets.VIVERE_PING_URL }}/$code"
Matching the schedule
Give the monitor the same cron expression as the workflow. GitHub schedules in UTC unless the schedule entry sets a timezone, so use UTC on the monitor too, or the same timezone the workflow names. GitHub documents that scheduled runs can be delayed at busy times, especially at the start of the hour, and does not say by how much, so start with a generous grace such as 1h and tighten it once you have seen your own run times. Scheduling at an odd minute, as in 17 3 * * *, makes delays less likely.
When a schedule misbehaves
- Scheduled workflow stopped running: the seven causes and three commands that tell them apart.
- Disabled after 60 days of inactivity: turning it back on and keeping it on.
- Runs late or is skipped: measuring the delay and triggering on time.
- Not triggering on a branch or a fork: the default-branch rule and testing a schedule before merging.
- Getting an alert when it does not run: watchdog workflows, polling and heartbeats compared.