GitHub Actions
Add a final step that pings your monitor only when the previous steps succeeded.
Scheduled workflow
For a workflow that runs on a schedule, add a ping step at the end of the job:
name: Nightly jobon: schedule: - cron: "0 3 * * *"
jobs: run: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: Do the work run: ./scripts/nightly.sh
- name: Ping Did My Job Run run: curl -fsS https://didmyjobrun.com/ping/${{ secrets.DMJR_PING_KEY }}- By default a step only runs if all previous steps succeeded, so if Do the work fails, the ping step is skipped and you get alerted.
- Store your ping key as a repository secret (here
DMJR_PING_KEY) rather than hardcoding it. Copy the key from your monitor on the dashboard.
Always run the ping logic, branch on outcome
If you’d rather have a single step that reports the real result, gate it on the job status:
- name: Ping on success only if: success() run: curl -fsS https://didmyjobrun.com/ping/${{ secrets.DMJR_PING_KEY }}Keep the monitor’s period at your schedule interval (1 day here) plus some grace, since GitHub’s scheduled runs can start a few minutes late.