---
title: "Ping CronMissed from GitHub Actions"
url: "https://cronmissed.com/snippets/github-actions.md"
canonical_url: "https://cronmissed.com/snippets/github-actions"
last_updated: "2026-10-22"
type: "how-to"
summary: "A GitHub Actions step that reports a scheduled workflow to CronMissed, with if: always() and the job status deciding the ping."
related: ["https://cronmissed.com/snippets.md", "https://cronmissed.com/guides/github-actions.md", "https://cronmissed.com/snippets/shell.md", "https://cronmissed.com/cron/every-day-at-4am.md", "https://cronmissed.com/learn/choosing-grace-time.md"]
---

# Ping CronMissed from GitHub Actions

> **For AI agents:** the complete index of CronMissed pages is [llms.txt](https://cronmissed.com/llms.txt). Every page is also served as markdown at its URL plus .md.

A GitHub Actions step that reports a scheduled workflow to CronMissed, with if: always() and the job status deciding the ping.

The last step of a scheduled workflow reports its result. With if: always() it runs even after a failed step, and the job status picks between the plain URL and /fail. The ping URL lives in a repository secret.

## What should a workflow job send?

- A request to `/start` before the work, so CronMissed can time the run and notice a job that never finishes.
- A request to the plain URL when the work succeeded, or to `/fail` when it did not. `/<exit status>` works too: 0 is a success and any other number is a failure.
- The end of the output in the request body, up to 100,000 bytes, so the alert shows the error without a trip to the server.

## What is the workflow?

```
on:
  schedule:
    - cron: '17 4 * * *'
jobs:
  nightly-build:
    runs-on: ubuntu-latest
    steps:
      # ... the job's own steps ...
      - name: Report to CronMissed
        if: always()
        env:
          PING_URL: ${{ secrets.CRONMISSED_PING_URL }}
          JOB_STATUS: ${{ job.status }}
        run: |
          if [ "$JOB_STATUS" = "success" ]; then suffix=""; else suffix="/fail"; fi
          curl -fsS --max-time 10 --retry 5 --retry-connrefused -o /dev/null "$PING_URL$suffix"
```

- Store https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10 as the repository secret CRONMISSED_PING_URL; the URL is the check's only credential.
- GitHub runs schedules at most every 5 minutes, in UTC unless a time zone is set.

Keep the ping URL in an environment variable or a secret store, never in a public repository: the URL is the check's only credential.

## How do I send a start ping and the log tail?

```
      - name: Tell CronMissed the job started
        run: curl -fsS --max-time 10 --retry 5 -o /dev/null "${{ secrets.CRONMISSED_PING_URL }}/start"
      # ... the job's steps, writing their output to build.log ...
      - name: Report with the end of the log
        if: always()
        env:
          PING_URL: ${{ secrets.CRONMISSED_PING_URL }}
          JOB_STATUS: ${{ job.status }}
        run: |
          if [ "$JOB_STATUS" = "success" ]; then suffix=""; else suffix="/fail"; fi
          tail -c 100000 build.log | curl -fsS --max-time 10 --retry 5 -o /dev/null --data-binary @- "$PING_URL$suffix"
```

Put the start step first in the job. The [GitHub Actions guide](https://cronmissed.com/guides/github-actions.md) lists what GitHub documents about delays and disabled schedules.

## Questions

### Why a secret and not a plain value?

Workflow files are often public. Anyone who sees the ping URL can send pings for that check, so keep it in a secret.

### Does the step run when the workflow is cancelled?

if: always() runs after cancellation too, with a job status of cancelled, so the step sends /fail. Use if: success() || failure() to skip cancelled runs.

## Sources

- [GitHub Docs: events that trigger workflows](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows), read 22 October 2026

## Related pages

- [GitHub Actions schedules](https://cronmissed.com/guides/github-actions.md)
- [Shell and curl](https://cronmissed.com/snippets/shell.md)
- [/cron/every-day-at-4am](https://cronmissed.com/cron/every-day-at-4am.md)
- [Choosing a grace time](https://cronmissed.com/learn/choosing-grace-time.md)

## Related

- [Ping snippets for 12 languages and tools](https://cronmissed.com/snippets.md)
- [GitHub Actions schedule cron: catch missed runs](https://cronmissed.com/guides/github-actions.md)
- [Ping CronMissed from a shell script with curl](https://cronmissed.com/snippets/shell.md)
- [Cron every day at 4am: 0 4 * * *](https://cronmissed.com/cron/every-day-at-4am.md)
- [How to choose a grace time for a cron check](https://cronmissed.com/learn/choosing-grace-time.md)
