Skip to the page

Recipes

GitHub recipes

Text yourself when a deploy fails or a release ships, from a GitHub Action or a webhook.

Two recipes for GitHub. Each names its trigger and the BlueBot step, lists the fields to map and says how to test it with your own number before anyone else gets a text.

How GitHub connects

  • API: Your own code calls BlueBot’s REST API and listens to its signed webhooks.
  • Text Hook: A Text Hook is a BlueBot address the app posts its own webhook to. You map its fields to a recipient and a template, and each post becomes a text.

Text me when a deploy fails

PartWhat it is
TriggerA GitHub Actions deploy job fails
ActionPOST /v1/messages
Connects throughAPI

Steps

  1. Save a BlueBot API key as a repository secret.
  2. Add a last step to the deploy job and give it if: failure() so it runs only when the job fails.
  3. Have the step call POST /v1/messages with curl and send your own number as to and a short message as text.

Map the fields

BlueBot fieldMap it to
toThe person’s mobile number from GitHub. US numbers can leave off the +1.
textDeploy of {{repository}} failed on {{branch}}. Run: {{run_url}}
{{repository}} in the textGitHub’s repository field.
{{branch}} in the textGitHub’s branch field.
{{run_url}} in the textGitHub’s run url field.
metadatasource set to github, and record_id set to the record’s id, so the status and reply webhooks for this text can find the record again.
serviceAuto, the default: iMessage when the person uses it, otherwise SMS through your iPhone.
POST/v1/messagesSend a text →
curl -X POST "https://usebluebot.com/api/v1/messages" \
  -H "Authorization: Bearer $BLUEBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: github-1042" \
  -d '{
    "to": "+15555550123",
    "text": "Deploy of (repository) failed on (branch). Run: (run url)",
    "metadata": {
      "source": "github",
      "record_id": "1042"
    }
  }'

Test it

Run the request with your own number in to. A text arrives on your phone from your own number.

Text me when a release is published

PartWhat it is
TriggerA GitHub Actions workflow that runs when a release is published
ActionA BlueBot Text Hook turns each post into a text
Connects throughText Hook

Steps

  1. Make a Text Hook in BlueBot with your own number as the recipient, and save its address as a repository secret.
  2. In the workflow, post the repository name and the release tag to the hook as JSON with curl.
  3. Run it once, then map repo and tag into the template from the payload BlueBot kept.

Map the fields

Text Hook settingSet it to
RecipientThe field in GitHub’s post that holds the person’s phone number, written as a path such as {{body.phone}}.
Text{{body.repo}} {{body.tag}} is out.
Metadatasource set to github. BlueBot adds the hook’s id by itself.

Test it

Post a sample to the hook’s address with your own number in the phone field, as below. A text arrives on your phone, and the hook’s page lists the post.

A test post shaped like GitHub’s
curl -X POST "https://usebluebot.com/h/YOUR_HOOK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"phone":"+15555550123","repo":"sample repo","tag":"sample tag"}'

Before you turn it on

  • Text only people who asked to hear from you. Anyone who replies STOP goes on your stop list, and BlueBot cancels texts to them. Stop words
  • A text that can’t go yet waits with a hold rather than failing: quiet hours, your Mac away, a daily limit. Holds
  • GitHub with BlueBot on the integrations page says what else the two do together.