GitHub pull request notifications on your phone.

Get a push notification when a pull request is opened, marked ready for review, gets a review request, or is merged.

pull_requestDeveloper toolsReleases 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 Pull requests.

STEP 03

Get a push on your phone

With the text, sound and buttons from the recipe.

Setup

How to set up the GitHub pull requests 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 Pull requests, and save. GitHub sends a ping right away.
  6. Tick **Pull requests** in the webhook's events. Pushes go out when a pull request is opened (not as a draft), marked ready for review, gets a review request, or is merged. Edits, syncs, labels and closes without merging are ignored.
  7. 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 → pull_request (pull request)
2// Get a push notification when a pull request is opened, marked ready for review, gets a review request, or is merged.
3// Docs: https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request
4
5// The pull request actions worth a push.
6const ACTIONS = {
7 opened: { emoji: "🔀", verb: "opened", priority: 0 },
8 ready_for_review: { emoji: "🔀", verb: "ready for review", priority: 0 },
9 review_requested: { emoji: "👀", verb: "review requested", priority: 0 },
10 merged: { emoji: "🟣", verb: "merged", priority: -1 },
11}
12
13// Header names can arrive in any case.
14function header(request, name) {
15 const headers = request.headers || {}
16 const key = Object.keys(headers).find((k) => k.toLowerCase() === name)
17 const value = key ? headers[key] : null
18 return Array.isArray(value) ? value[0] : value
19}
20
21// Only link to real http(s) URLs.
22function link(url, cta) {
23 return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : []
24}
25
26function handleRequest(request) {
27 const body = request.body && typeof request.body === "object" ? request.body : {}
28 const event = header(request, "x-github-event")
29
30 // Saving the webhook makes GitHub send a ping; confirm the connection quietly.
31 if (event === "ping" || (body.zen && body.hook_id)) {
32 return {
33 title: "🔔 GitHub connected",
34 message: `Webhook for ${body.repository?.full_name ?? body.organization?.login ?? "your account"} is working`,
35 topic: "GitHub",
36 priority: -1,
37 }
38 }
39
40 // Guard: only pull_request events. The header decides when it's there; the payload's
41 // shape is the fallback (for example in Studio's Test runner).
42 if (event ? event !== "pull_request" : !(body.pull_request)) {
43 console.log(`Ignoring GitHub "${event ?? "unknown"}" event`)
44 return null
45 }
46
47 const repo = body.repository?.full_name ?? "a repository"
48 const pr = body.pull_request
49 // GitHub reports a merge as "closed" with merged: true.
50 const action = body.action === "closed" && pr?.merged ? "merged" : body.action
51
52 // Drafts aren't ready for eyes yet; closed-without-merge and edits are skipped too.
53 if (!pr || !Object.prototype.hasOwnProperty.call(ACTIONS, action) || (action === "opened" && pr.draft)) {
54 console.log(`Skipping pull request action "${body.action}"`)
55 return null
56 }
57
58 const what = ACTIONS[action]
59 const who =
60 action === "review_requested"
61 ? body.requested_reviewer?.login ?? body.requested_team?.name
62 : action === "merged"
63 ? pr.merged_by?.login
64 : pr.user?.login
65 const detail =
66 action === "review_requested"
67 ? who ? `from @${who}` : null
68 : who ? `by @${who}` : null
69 const branches = pr.head?.ref && pr.base?.ref ? `${pr.head.ref} → ${pr.base.ref}` : null
70
71 return {
72 title: `${what.emoji} PR #${pr.number} ${what.verb}: ${pr.title}`,
73 message: [repo, branches, detail].filter(Boolean).join(" · "),
74 topic: "GitHub",
75 priority: what.priority,
76 buttons: link(pr.html_url, "View pull request"),
77 }
78}
Payload

The GitHub pull_request webhook

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

pull_request · sample.json
1{
2 "action": "opened",
3 "number": 42,
4 "sender": {
5 "login": "sam-lee"
6 },
7 "repository": {
8 "full_name": "acme/web"
9 },
10 "pull_request": {
11 "base": {
12 "ref": "main"
13 },
14 "head": {
15 "ref": "feature/apple-pay"
16 },
17 "user": {
18 "login": "sam-lee"
19 },
20 "draft": false,
21 "state": "open",
22 "title": "Add Apple Pay to checkout",
23 "merged": false,
24 "number": 42,
25 "html_url": "https://github.com/acme/web/pull/42"
26 }
27}
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 pull request 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.