Skip to main content
All posts
Developers4 min read

How to Send GitHub Deployment Approval Notifications

Give your release coordinator one Ping when a GitHub Actions deployment needs review, with the approval itself handled in GitHub.

Pingo examines a closed paper folder while two teammates wait by a closed laptop and a face-down phone.

Use GitHub Mobile if you're the required reviewer and just want a phone notification. If someone else coordinates the release, send them a short Ping when the workflow reaches the review step. They can hold the handoff while the reviewer opens GitHub to approve or reject the deployment.

GitHub explains how to receive mobile notifications and review a deployment.

Give the coordinator one clear instruction

Example. A release coordinator is due to tell support when to start a launch walkthrough. The workflow pauses for a required reviewer. The coordinator needs to know the handoff should wait, even if the reviewer is already looking at the run.

Create a private Release Handoff Room and invite only the people who need that cue. As the Room owner, add an incoming webhook with Custom message. Save Release review pending as the title and Hold the support handoff. Check the run in GitHub. as the message. Use a plain Ping and have the recipient enable phone notifications. A Room supports up to four incoming webhooks. Free owners can keep one active across their Rooms, and PingRoom Pro lifts that account-wide limit.

Pingo stands by the closed folder as a teammate checks a phone and the reviewer looks at the laptop.

Pingo the Pigeon, our fictional Chief Marketing Officer, studies the closed folder. The review screen is across the desk, with the person who can make the call.

Check one run and one environment

Start in a sandbox repository with an environment that has a required reviewer and no wait timer. Keep the same review rule you would use without the phone cue. Required reviewers are available in public repositories on current GitHub plans. On GitHub Free, Pro and Team, this rule is limited to public repositories. Check GitHub's environment rules and plan requirements before using a private repository.

Run the check from a separate trusted process with the GitHub CLI, jq and curl installed. A job gated by the environment has to wait before its steps can run. Load GH_TOKEN from your secret store with fine-grained Actions: read access to the selected repository. Store the dedicated webhook URL separately in PINGROOM_WEBHOOK_URL. Set REPOSITORY to the trusted owner and repository, RUN_ID to the workflow run number from its URL, and REVIEW_ENVIRONMENT to the exact environment name. For example, use handoff-test for the sandbox.

The pending deployments endpoint returns the environments waiting on protection rules. Check the one you configured for required review and look for a nonempty reviewers list. The POST sends the saved room message with an empty body, so reviewer names and workflow details stay in GitHub.

set -euo pipefail

: "${REPOSITORY:?Set the owner and repository}"
: "${RUN_ID:?Set the workflow run ID}"
: "${REVIEW_ENVIRONMENT:?Set the environment name}"
: "${GH_TOKEN:?Set a GitHub read token}"
: "${PINGROOM_WEBHOOK_URL:?Set the Room webhook URL}"
[[ "$RUN_ID" =~ ^[1-9][0-9]*$ ]] || exit 2

pending=$(gh api --method GET \
  "repos/$REPOSITORY/actions/runs/$RUN_ID/pending_deployments")

needs_review=$(jq -rs --arg environment "$REVIEW_ENVIRONMENT" '
  if length != 1 or (.[0] | type) != "array" then
    error("Expected one pending deployments array")
  else
    .[0] | any(.[];
      .environment.name == $environment
      and (.reviewers | type == "array" and length > 0)
    )
  end
' <<< "$pending")

if [[ "$needs_review" == true ]]; then
  status=$(curl --fail --silent --show-error --max-time 10 \
    --request POST --output /dev/null \
    --header "Idempotency-Key: review-$RUN_ID" \
    --write-out "%{http_code}" "$PINGROOM_WEBHOOK_URL") || exit $?
  [[ "$status" == 2[0-9][0-9] ]] || exit 1
  printf '%s\n' 'Ping accepted'
fi

Use one dedicated webhook for this repository and environment. For a rehearsal, check manually before the release deadline. If you already have a release monitor, you can have it repeat the check for the selected run during a short handoff window and stop when the check prints Ping accepted. Use the same key if you retry an uncertain result. PingRoom retains idempotency receipts for at least an hour. If your monitor can restart or run beyond that window, persist sent run IDs. This example treats a rerun of the same workflow run as part of the same handoff.

Rehearse the handoff before using it

Sandbox observationExpected Room behaviorCoordinator's next step
A preview or unrelated environment is pendingQuietCheck the selected run and environment in GitHub.
The selected environment is waiting for required reviewOne PingHold the support handoff and check the run.
The next check sees the same pending reviewNo second Ping within the idempotency windowKeep waiting for GitHub's decision.
The required reviewer clears the requestQuiet once the review is no longer pendingConfirm the deployment's own results before telling support to start.

A Ping describes what was pending at the time of the check. Open the run to see its current state. If the review clears between checks, you may receive no Ping. If the agreed window closes without one, use the GitHub run as your reference.

For post-deploy outcomes, use the GitHub Actions results guide. If your CI design needs the human to decide in PingRoom itself, see the CI approval gate pattern.

Set up a Room webhook for your sandbox rehearsal.

The illustrations are AI-generated editorial scenes with fictional characters.

PingRoom

Short-form communication.

View all posts