GitHub Actions
Add a final step that pings your monitor only when the previous steps succeeded.
Scheduled workflow
Section titled “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://api.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.
Make the success condition explicit
Section titled “Make the success condition explicit”The implicit behaviour above is enough, but if you want the intent spelled out, add if: success() to the ping step. It runs only when every earlier step succeeded — a failed run skips the ping and you get alerted:
- name: Ping on success only if: success() run: curl -fsS https://api.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.