GitHub workflow failed notifications on your phone.

Get a High-priority push notification when a GitHub Actions workflow run fails, times out or can't start.

workflow_runDeveloper toolsMonitoring Signature verified
How it works

Three steps to your first push

STEP 01

Install the recipe

One click in Studio gives you a personal webhook URL.

STEP 02

Paste your URL into GitHub

Add it as a webhook for Workflow runs.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the GitHub workflow runs webhook

  1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL.
  2. In your repository (or organization), go to Settings > Webhooks and click Add webhook.
  3. Paste your webhook URL as the Payload URL and set Content type to application/json.https://••••••••/•••••••• your personal URL, shown after install
  4. Enter a secret and copy the same secret into JustPush.
  5. Choose Let me select individual events, tick Workflow runs, and save. GitHub sends a ping right away.
  6. Tick **Workflow runs** in the webhook's events. Only failed, timed-out or unstartable runs push by default. Add `?all=1` to the Payload URL to also get a quiet push when a run passes:
  7. ```
  8. your webhook URL?all=1
  9. ```
  10. On an organization webhook this covers every repository in the organization.
  11. GitHub signs every delivery with your secret (`X-Hub-Signature-256`), and JustPush checks it, so requests that don't come from GitHub are rejected.
The code

What runs when the webhook arrives

Studio calls handleRequest(request) with the incoming webhook and sends the message it returns. It's yours after install; change anything.

transform.js
1// GitHub → workflow_run (workflow failed)
2// Get a High-priority push notification when a GitHub Actions workflow run fails, times out or can't start.
3// Docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#workflow_run
4
5// Conclusions that deserve a push, and how to describe them.
6const FAILURES = {
7 failure: "failed",
8 timed_out: "timed out",
9 startup_failure: "couldn't start",
10}
11
12// Header names can arrive in any case.
13function header(request, name) {
14 const headers = request.headers || {}
15 const key = Object.keys(headers).find((k) => k.toLowerCase() === name)
16 const value = key ? headers[key] : null
17 return Array.isArray(value) ? value[0] : value
18}
19
20// Only link to real http(s) URLs.
21function link(url, cta) {
22 return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : []
23}
24
25function handleRequest(request) {
26 const body = request.body && typeof request.body === "object" ? request.body : {}
27 const event = header(request, "x-github-event")
28
29 // Saving the webhook makes GitHub send a ping; confirm the connection quietly.
30 if (event === "ping" || (body.zen && body.hook_id)) {
31 return {
32 title: "🔔 GitHub connected",
33 message: `Webhook for ${body.repository?.full_name ?? body.organization?.login ?? "your account"} is working`,
34 topic: "GitHub",
35 priority: -1,
36 }
37 }
38
39 // Guard: only workflow_run events. The header decides when it's there; the payload's
40 // shape is the fallback (for example in Studio's Test runner).
41 if (event ? event !== "workflow_run" : !(body.workflow_run)) {
42 console.log(`Ignoring GitHub "${event ?? "unknown"}" event`)
43 return null
44 }
45
46 const repo = body.repository?.full_name ?? "a repository"
47 const run = body.workflow_run
48 // ?all=1 on the webhook URL also sends a quiet push for successful runs.
49 const all = ["1", "true", "yes"].includes(String(request.query?.all ?? "").toLowerCase())
50 const failed = Object.prototype.hasOwnProperty.call(FAILURES, run?.conclusion)
51
52 if (body.action !== "completed" || !run || (!failed && !(all && run.conclusion === "success"))) {
53 console.log(`Skipping workflow run "${run?.conclusion ?? body.action}"`)
54 return null
55 }
56
57 const name = run.name ?? "Workflow"
58 const where = [repo, run.head_branch].filter(Boolean).join(" · ")
59 const what = run.display_title ?? run.head_commit?.message?.split("\n")[0]
60 const who = run.triggering_actor?.login ?? run.actor?.login
61
62 return {
63 title: failed ? `❌ ${name} ${FAILURES[run.conclusion]}` : `✅ ${name} passed`,
64 message: where + (what ? ` — ${what}` : "") + (who ? ` (@${who})` : ""),
65 topic: "GitHub",
66 priority: failed ? 1 : -1, // High for broken builds, Low for the optional success pushes
67 buttons: link(run.html_url, "View run"),
68 }
69}
Payload

The GitHub workflow_run webhook

This is what GitHub sends to your URL for workflow runs. It is a sample, trimmed to the fields recipes use.

workflow_run · sample.json
1{
2 "action": "completed",
3 "sender": {
4 "login": "janedoe"
5 },
6 "workflow": {
7 "id": 159038,
8 "name": "CI",
9 "path": ".github/workflows/ci.yml"
10 },
11 "repository": {
12 "id": 1296269,
13 "html_url": "https://github.com/acme/web",
14 "full_name": "acme/web"
15 },
16 "workflow_run": {
17 "id": 30433642,
18 "name": "CI",
19 "actor": {
20 "login": "janedoe"
21 },
22 "event": "push",
23 "status": "completed",
24 "head_sha": "acb5820ced9479c074f688cc328bf03f341a511d",
25 "html_url": "https://github.com/acme/web/actions/runs/30433642",
26 "conclusion": "failure",
27 "run_number": 562,
28 "head_branch": "main",
29 "head_commit": {
30 "id": "acb5820ced9479c074f688cc328bf03f341a511d",
31 "author": {
32 "name": "Jane Doe"
33 },
34 "message": "Fix checkout totals rounding\n\nCloses #88"
35 },
36 "run_attempt": 1,
37 "display_title": "Fix checkout totals rounding",
38 "triggering_actor": {
39 "login": "janedoe"
40 }
41 }
42}
Security

How the GitHub signature is verified

X-Hub-Signature-256

GitHub signs every webhook with an HMAC-SHA256 hash of the request body in the X-Hub-Signature-256 header, made with the secret you set on the webhook. Add the secret to the recipe in Studio and JustPush checks every request before your code runs, so requests that don't come from GitHub never reach your phone.

FAQ

GitHub workflow failed notifications: questions

Does this work on iPhone and Android?

Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification.

Do I need to write code?

No. Install the recipe in Studio, paste your webhook URL into GitHub and you are done. The code is there if you want to change the text, the sound or the buttons.

Can I change what the notification says?

Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save.

What does it cost?

JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.

Ready when you are

GitHub on your phone in two minutes.

Install the recipe, paste one URL, done. Free for 30 days, no credit card required.