Docs · Integrations
GitHub Actions
Report a scheduled workflow's runs to PingDing, including failed and cancelled ones.
Published at launch. The action's address is announced then; the lines below use a placeholder for it.
The action reports a job to a check: /start when the job begins, then how it ended. It needs only bash and curl, and it never changes the job's result.
on:
schedule:
- cron: "0 3 * * *"
jobs:
backup:
runs-on: ubuntu-latest
steps:
- uses: <pingding-action>@<commit SHA>
with:
ping-key: ${{ secrets.PINGDING_PING_KEY }}
status: start
- run: ./nightly-backup.sh
- uses: <pingding-action>@<commit SHA>
if: always()
with:
ping-key: ${{ secrets.PINGDING_PING_KEY }}
status: ${{ job.status }}
Store the ping key as a repository or environment secret. The first step times the run; the last one needs if: always() so it also runs after a failed step.
Inputs
| Input | Default | What it is |
|---|---|---|
ping-key |
required | The check's ping key, from a secret. |
status |
required | start first; ${{ job.status }} last. Also takes success, failure, cancelled, skipped or an exit code. |
ping-base-url |
hosted | A self-hosted install's ping base. |
on-cancelled |
fail |
fail reports a cancelled run as a failure; skip sends nothing. |
run-details |
true |
Send the repository, workflow, run number and link as the ping's log. |
fail-on-error |
false |
Fail the step if the ping isn't recorded. By default the action only warns. |
Tips
- Use one check per job, and per matrix leg. Jobs sharing a check would close each other's runs.
- A workflow run from a fork has no secrets, so the action warns and sends nothing.
- Pin the action to a full commit SHA: a tag can be moved.