# Approve the prod deploy *from your phone.*

> GitHub Actions manual approval on WhatsApp: the job pauses, asks with ship-it/abort buttons, deploys only on your tap. No Twilio, no protected-environment plan.

Recipe · CI/CD

The pipeline pauses, asks on WhatsApp, and continues only on your tap. One step in your GitHub Actions workflow sends the question with **ship it / abort** buttons (`POST /v1/ask` under the hood) and blocks until you answer; the deploy step runs only when the answer is the first button. No reply means **no deploy**: silence never ships. And when the job finishes, a one-line ping (`POST /v1/notify`) tells you how it went.

Prefer to deploy to staging first? Send the alert with **Approve** and **Rollback** as buttons under it: § 4.

§ 1

## The gate: ship it or abort

Two steps: the gate asks and waits (up to 90 seconds, the server maximum), the deploy runs behind an `if` on the gate's `button-id` output. That's the whole wiring: the action is `grzgrzgrz3/pingwa-action`, your key sits in a repo secret.

.github/workflows/deploy.yml

```
name: deploy
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Ask before shipping
        id: gate
        uses: grzgrzgrz3/pingwa-action@v1
        with:
          api-key: ${{ secrets.PINGWA_KEY }}
          mode: ask
          message: "Deploy ${{ github.repository }} @ ${{ github.sha }} to prod?"
          buttons: "ship it,abort"

      - name: Deploy
        if: steps.gate.outputs.button-id == 'b0'
        run: ./deploy.sh
```

The fail-safe reading: if you don't answer within the 90 seconds, `/v1/ask` returns **HTTP 408** and the gate step **fails**: the deploy step never runs. Tapping **abort** keeps the gate green with `button-id=b1` and the deploy is simply skipped. `button-id` is positional: `b0` is the first label you passed, `b1` the second. Only an explicit `b0` ships. The question was still delivered to your phone either way; a late tap is retrievable afterwards via `GET /v1/messages/<id>/reply`.

If the ask lands outside your 24h reply window (likely, for deploys that arrive out of the blue), the buttons arrive as a numbered list instead of tap buttons. Replying **1** (or the button's text, **ship it**) works the same and still maps to `b0`.

The action lives at [github.com/grzgrzgrz3/pingwa-action](https://github.com/grzgrzgrz3/pingwa-action): composite, curl + jq, ~40 lines. Get a key: send **join** on WhatsApp, store it as the `PINGWA_KEY` repo secret.

§ 2

## The done-ping: how did it go?

Same action, `mode: notify` (the default). With `if: always()` the ping fires on success *and* failure, and `job.status` puts the verdict in the message. The deploy you approved from the couch reports back to the couch.

deploy.yml: last step of the job

```
      - name: Ping when done
        if: always()
        uses: grzgrzgrz3/pingwa-action@v1
        with:
          api-key: ${{ secrets.PINGWA_KEY }}
          message: "${{ github.workflow }} on ${{ github.repository }}: ${{ job.status }}"
```

§ 3

## Not on GitHub? Two curls

GitLab CI, Jenkins, Woodpecker, a bare deploy script: the gate is the same `/v1/ask` call with a `jq` check on `.reply.button_id`. The GitHub action is exactly this curl inside; there's nothing platform-specific about the pattern.

deploy-gate.sh: GitLab CI / Jenkins / anything

```
reply=$(curl -sS --max-time 95 -X POST https://pingwa.dev/v1/ask \
  -H "Authorization: Bearer $PINGWA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Deploy to prod?", "buttons": ["ship it","abort"], "timeout": 90}')

[ "$(printf '%s' "$reply" | jq -r '.reply.button_id')" = "b0" ] || exit 1
./deploy.sh

curl -sS -X POST https://pingwa.dev/v1/notify \
  -H "Authorization: Bearer $PINGWA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "deploy: done"}'
```

Same fail-safe shape: the gate compares against `b0`, so anything else fails it. A 408 or error body makes `jq` print `null`, an abort tap yields `b1`, and either way `exit 1` stops the script before the deploy line. One difference from the GitHub variant: that `exit 1` also skips the final notify (a bare script has no `if: always()`). Move the notify before the exit, or `trap` it, if you want failure pings too.

§ 4

## Two buttons on the alert: Approve and Rollback

The gate in § 1 asks one question and waits for it. This is the other shape: the workflow deploys to **staging** first, then sends an alert (`POST /v1/notify`) with two buttons under it, **Approve** (ship it to production) and **Rollback** (undo the staging deploy). Each button is an *action*: a tap runs it and delivers an event to your CI that names the deploy it belongs to. Rollback asks “Run Rollback?” first, so a stray tap does nothing.

pingwa · WhatsApp

myapp is on staging (run 8123456789). Approve ships it to production.

buttons under it: Approve · Rollback

The alert carries two more fields besides the buttons. `topic` is the service it is about (`myapp`), and `ref` is your own string, here the workflow's run id. It comes back with the tap as `context.ref`, which is how the CI knows *which* deploy was approved. Setup, once, from your laptop, with the full-access key you got from **join**:

1. Create the two actions. They have no `target_url`, so a tap is delivered to a listener, not to an address. `confirm` makes Rollback ask Yes / Cancel first. Each answer holds the action's `id`: store them as the repo variables `PINGWA_APPROVE_ID` and `PINGWA_ROLLBACK_ID`.

The two actions

```
curl -X POST https://pingwa.dev/v1/actions \
  -H "Authorization: Bearer pw_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label": "Approve", "reply_ok": "Approved"}'

curl -X POST https://pingwa.dev/v1/actions \
  -H "Authorization: Bearer pw_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label": "Rollback", "confirm": true, "reply_ok": "Rolling back"}'
```

1. Make a key for the waiting job that can do nothing but receive taps. Its scope is `actions:listen`; the answer holds the key once. Store it as the repo secret `PINGWA_LISTEN_KEY`. The key from the action itself, `PINGWA_KEY`, stays the send-only key of § 1.

A key for the waiting job only

```
curl -X POST https://pingwa.dev/v1/keys \
  -H "Authorization: Bearer pw_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "ci-listen", "scopes": ["actions:listen"]}'
```

The alert goes out as the last step of the staging job. The `actions` list holds the two ids, in the order the buttons show. Inside your 24h reply window they are tap buttons; outside it the alert lists them as “1) Approve 2) Rollback” and replying **1** or **2** does the same.

§ 5

## Receive the tap: the workflow waits (pull, no public address)

A GitHub runner has no address pingwa can call. So the second job asks pingwa for the tap instead (a long poll, `GET /v1/actions/events`) and blocks until it arrives, or until it gives up. Three files in your repo: the workflow, `wait-for-tap.sh` and your own `deploy.sh` / `rollback.sh`. Nothing here is a GitHub feature beyond jobs, steps and `if`: the wait is a polling loop with a timeout.

.github/workflows/deploy.yml

```
name: deploy
on:
  push:
    branches: [main]

jobs:
  staging:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Deploy to staging
        run: ./deploy.sh staging

      - name: Alert with Approve and Rollback
        env:
          PINGWA_KEY: ${{ secrets.PINGWA_KEY }}
          APPROVE_ID: ${{ vars.PINGWA_APPROVE_ID }}
          ROLLBACK_ID: ${{ vars.PINGWA_ROLLBACK_ID }}
          REF: ${{ github.run_id }}
        run: |
          jq -n --arg ref "$REF" --arg approve "$APPROVE_ID" --arg rollback "$ROLLBACK_ID" '{
            text: "myapp is on staging (run \($ref)). Approve ships it to production.",
            actions: [$approve, $rollback], topic: "myapp", ref: $ref}' |
          curl -fsS -X POST https://pingwa.dev/v1/notify \
            -H "Authorization: Bearer $PINGWA_KEY" \
            -H "Content-Type: application/json" -d @-

  decide:
    needs: staging
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v4

      - name: Wait for the tap
        id: tap
        env:
          PINGWA_LISTEN_KEY: ${{ secrets.PINGWA_LISTEN_KEY }}
          REF: ${{ github.run_id }}
        run: |
          decision=$(./wait-for-tap.sh "$REF")
          echo "decision=$decision" >> "$GITHUB_OUTPUT"

      - name: Ship to production
        if: steps.tap.outputs.decision == 'Approve'
        run: ./deploy.sh production

      - name: Roll staging back
        if: steps.tap.outputs.decision == 'Rollback'
        run: ./rollback.sh staging

      - name: Ping when done
        if: always()
        uses: grzgrzgrz3/pingwa-action@v1
        with:
          api-key: ${{ secrets.PINGWA_KEY }}
          message: "${{ steps.tap.outputs.decision }} for run ${{ github.run_id }}: ${{ job.status }}"
```

The wait script is the whole receiving side. It polls for up to `WAIT_SECONDS` (600 by default) and looks at each event's `label` and `context.ref`. A tap that matches this run's ref is answered at once, inside the 15 seconds pingwa allows, and the script prints the button's name. Any other tap is answered “not this deploy”. If nobody taps, it exits 1: the step fails and neither deploy nor rollback runs, so **silence ships nothing**. The script runs your commands *after* the answer, not inside it, so a slow rollback never misses the 15 seconds; the ping at the end reports how it went.

wait-for-tap.sh

```
#!/usr/bin/env bash
# wait-for-tap.sh <ref>: prints Approve or Rollback when that button of THIS deploy is
# tapped. Exits 1 when WAIT_SECONDS (default 600) pass without a tap.
# PINGWA_LISTEN_KEY: a key with the actions:listen scope.
set -euo pipefail
ref="${1:?usage: wait-for-tap.sh <ref>}"
base="https://pingwa.dev"
end=$(( $(date +%s) + ${WAIT_SECONDS:-600} ))
api() { curl -fsS -m 45 -H "Authorization: Bearer $PINGWA_LISTEN_KEY" "$@"; }

# answer <run_id> <true|false> <text>: the text goes back to the person who tapped
answer() {
  jq -n --argjson ok "$2" --arg reply "$3" '{ok: $ok, reply: $reply}' |
    api -X POST -H "Content-Type: application/json" -d @- \
      "$base/v1/actions/events/$1/result" >/dev/null
}

while left=$(( end - $(date +%s) )); [ "$left" -gt 0 ]; do
  [ "$left" -gt 30 ] && left=30
  events=$(api "$base/v1/actions/events?wait=$left&max=4") || { sleep 5; continue; }
  decision=""
  while IFS=$'\t' read -r run_id label event_ref; do
    if [ -z "$decision" ] && [ "$event_ref" = "$ref" ] &&
       { [ "$label" = "Approve" ] || [ "$label" = "Rollback" ]; }; then
      answer "$run_id" true "Got it: $label for run $ref"
      decision="$label"
    else
      answer "$run_id" false "Not the deploy waiting now (run $ref)" || true
    fi
  done < <(jq -r '.events[] | [.run_id, .label, (.context.ref // "")] | @tsv' <<<"$events")
  if [ -n "$decision" ]; then echo "$decision"; exit 0; fi
done
echo "no tap for run $ref within ${WAIT_SECONDS:-600}s" >&2
exit 1
```

Two limits to know. A tap is handed to **one** poller, so keep to one deploy waiting at a time per account: a tap for a different run is answered and lost to the one that was waiting for it. And the wait costs runner minutes while it runs, so keep `timeout-minutes` on the job. Not on GitHub? The script is plain bash and curl: it runs unchanged in any CI that can run a shell step.

§ 6

## Receive the tap with a webhook (your CI has a public HTTPS endpoint)

If your CI can listen on a public HTTPS address, create the actions with a `target_url` instead and pingwa calls it: one signed POST per tap, no waiting job. Your endpoint is the one that starts the production deploy or the rollback, for the `context.ref` it was sent.

The two actions with a target_url

```
curl -X POST https://pingwa.dev/v1/actions \
  -H "Authorization: Bearer pw_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label": "Approve", "target_url": "https://ci.example.com/pingwa/approve"}'

curl -X POST https://pingwa.dev/v1/actions \
  -H "Authorization: Bearer pw_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label": "Rollback", "confirm": true, "target_url": "https://ci.example.com/pingwa/rollback"}'
```

Each answer carries the action's `secret`, once; it signs every POST of that action. The alert is sent exactly as in § 4. The tap arrives as:

POST https://ci.example.com/pingwa/approve

```
{
  "event": "action_triggered",
  "run_id": "9f2c1d7e",
  "action_id": "b41a0c33",
  "label": "Approve",
  "actor": {"name": "me", "role": "owner"},
  "triggered_at": "2026-11-14T10:02:11+00:00",
  "context": {"message_id": "5d0e7a12", "ref": "8123456789"}
}
```

Before acting, check the `X-Pingwa-Signature` header: the HMAC-SHA256 of the exact raw body with that action's secret. Refuse a `triggered_at` older than 5 minutes and act at most once per `run_id`, because a captured request stays validly signed. The check, with code, is in the Actions section of [llms.txt](/llms.txt). Answer with `{"reply": "Shipping run 8123456789"}` and that text goes back to the chat. Already made the actions for § 5? Switch one with a PATCH; it keeps the secret its creation showed, so if you did not keep it, delete the action and create it again:

Switch an existing action to a webhook

```
curl -X PATCH https://pingwa.dev/v1/actions/ACTION_ID \
  -H "Authorization: Bearer pw_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"target_url": "https://ci.example.com/pingwa/approve"}'
```

- **Run against a local pingwa server on 2026-11-14:** the actions, the listener key and the alert from the commands above; a signed Rollback tap with its confirmation, received by `wait-for-tap.sh` with the run id back in `context.ref`; a tap for another run refused and a silent wait ending in exit 1; an Approve tap delivered as a signed POST to a local receiver. GitHub itself was not run (the workflow's jq and shell steps were), and the taps were simulated by signed WhatsApp webhooks, not made on a phone.
- **Who can tap.** Only the owner of the number, plus the team members the alert was sent to. The first tap handles the alert; a second tap is told it was already handled.
- **Limits and price.** A tap counts as one message against your plan's message quota, and the number of actions is part of the plan. Plans and prices are in the [pricing](/#pricing) section.

§ 7

## FAQ

### GitHub Actions manual approval without environments?

Honest answer: GitHub's **protected environments** with required reviewers are the right tool for org-grade compliance (audit trails, review groups, policy). This recipe is the **solo-dev phone tap**: no environment configuration, no plan requirement, and the approval reaches you where you already are, on WhatsApp, away from the laptop. If you're one person shipping your own project, a tap beats opening github.com on mobile to hunt for the review button.

### Will the job hang while it waits?

At most 90 seconds: that's the server maximum for `/v1/ask`'s long-poll, after which the gate step fails and the job ends without deploying. The action can't wait longer than that, so a forgotten question costs you a couple of runner minutes, not hours. Belt and braces: set a job-level `timeout-minutes` anyway, as you would for any job.

### Can I really approve a deployment from my phone?

Yes, that's § 1. The workflow sends the question with buttons to your WhatsApp and genuinely blocks on the gate step; your tap is the approval. Tap **ship it** and the deploy step runs, tap **abort** or ignore it and nothing ships. Get a key by sending **join** once, add it as the `PINGWA_KEY` secret, paste the workflow.

### Is the action safe to put in my pipeline?

It's a composite action: one bash step, `curl` + `jq` only (both preinstalled on GitHub runners), zero third-party dependencies, ~40 lines. Read [action.yml](https://github.com/grzgrzgrz3/pingwa-action/blob/main/action.yml) yourself: it fits on a screen. If your supply-chain policy is strict, pin it by full commit SHA instead of `@v1`.

[Send “join” on WhatsApp →](https://wa.me/48797882513?text=join%20deploy) [More recipes](/use-cases) [Read the API](/docs)

![QR code to join pingwa on WhatsApp](/join.svg?tag=deploy&n=48797882513)

Scan the code and get instant access. It opens WhatsApp with “join” ready to send, and your API key comes straight back.

Deploy gates are exactly the messages you want rare and deliberate. The free plan's 30 paid messages a month cover a healthy release cadence, and your button-tap replies inside the 24h window are free.
