All guides
Cron jobs·3 min read

RECIPE: GITHUB ACTIONS

Monitor a scheduled GitHub Actions workflow.

1

Store the push URL as a secret

In your repository, open Settings → Secrets and variables → Actions and add a secret named UPGURU_PUSH_URL with your push URL.

2

Add two steps to the workflow

One reports success, the other a failure with a link to the failed run:

name: Nightly import

on:
  schedule:
    - cron: "0 2 * * *"   # every day at 02:00 UTC
  workflow_dispatch:       # lets you run it by hand

jobs:
  import:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: ./scripts/import.sh

      - name: Tell UPGURU it worked
        if: success()
        run: curl -fsS -X POST "${{ secrets.UPGURU_PUSH_URL }}" -d "Import finished"

      - name: Tell UPGURU it failed
        if: failure()
        run: >
          curl -fsS -X POST "${{ secrets.UPGURU_PUSH_URL }}?level=error"
          -d "Import failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
3

Expect the push every day

Set Expect a Push At Least Every to 24 hours.

GitHub can start scheduled workflows late and switches them off in repositories without activity for 60 days. The expected push catches both.