Skip to content

Code hosts in Webalert

Many incidents start with a deploy. A code host tells Webalert what was deployed or merged, where and when, so an incident shows the change just before it and Webalert AI can weigh it.

You can connect GitHub, or send deploys from any CI or script to a deploy webhook. Webalert reads deploys and merges. It never pushes code, opens pull requests or changes anything in your repositories.

What a code host adds

  • What changed before an incident. The incident page lists the deploys and merges in the hour before it opened, each with how many minutes before. Its alert email and Slack message name the nearest one.
  • Deploys where they ran. A server’s page shows its last deploy and the deploys of the last 14 days. Its charts and your dashboards mark when each deploy went out.
  • Facts for Webalert AI. When it looks into an incident it reads the same deploys and merges, with their times, so it can tell a bad deploy from a full disk.

Connect GitHub

  1. In Webalert, open Settings → Code hosts and choose Connect GitHub.
  2. On GitHub, pick the account or organization to install the Webalert app on, and the repositories it may see. Pick only the ones you want.
  3. GitHub sends you back to Webalert, which lists the repositories it can see.

Webalert then receives, for those repositories:

  • Deploys from GitHub deployments: started, succeeded or failed, with the environment, the commit and who started it.
  • Merges: pull requests merged into the default branch, and pushes straight to it.

A merge is not a deploy. Webalert keeps both and labels them, so “merged at 14:02” is never read as “live at 14:02”.

Each repository has a Receive deploys switch. Turned off, Webalert drops what GitHub sends for it. To add or take away repositories, change the app’s repository access on GitHub; Webalert follows. A repository whose default branch has no branch protection says so.

Workflows that deploy

If you deploy with a GitHub Actions workflow and do not use GitHub deployments, choose Use a workflow instead on the repository and name the workflows that deploy, such as Deploy. Their finished runs on the default branch then count as deploys. A cancelled or skipped run does not.

A deploy webhook

For deploys from anywhere else (Jenkins, GitLab CI, a deploy script, a PaaS), choose Add a deploy webhook in Settings → Code hosts and give it a name. Webalert shows an address and a secret. The secret is shown once; if you lose it, make a new one and the old one stops working at once.

After each deploy, post to the address:

curl -X POST <the webhook’s address> \
  -H "Authorization: Bearer <secret>" \
  -H "Content-Type: application/json" \
  -d '{"service":"api","version":"'"$GIT_SHA"'","environment":"production","status":"succeeded"}'
FieldWhat it is
serviceRequired. The name of what was deployed, such as api. Each service becomes a line in Settings → Code hosts that you link like a repository. Up to 50 per webhook.
statusstarted, succeeded or failed; succeeded when left out. Send started first and succeeded after to show how long it took.
versionThe commit or version that went out.
environmentSuch as production. Links can be limited to one environment.
idYour own id for the deploy, so a started and a succeeded are one deploy. Without it, the same version and environment are.
title, actor, urlWhat changed, who deployed it, and a link to the run or the pull request.
started_at, finished_atISO 8601 times, when the deploy is sent later than it happened.

An account can have up to 10 deploy webhooks.

Where it shows

  • An incident’s page: a “What changed” card with the deploys and merges in the hour before it opened, each linked to its pull request or run. Changes after it opened are in the incident’s timeline, so nothing shows twice.
  • The alert: its email and Slack message name the deploy or merge nearest before it.
  • A server’s page: the last deploy in the header, and a Deploys card with the last 14 days, newest first, failed ones in red. A server group has the same card for its members.
  • Charts: the charts on a server’s or group’s page and on your dashboards mark each deploy where it landed, next to incidents and fixes.
  • Settings → Code hosts: each connection with its repositories and their links.

Webalert AI and MCP

With Webalert AI on, an investigation reads the deploys and merges around the incident, how long before it opened each was, and which repositories are linked to the server or monitor in trouble. Webalert gives it the facts; whether a deploy caused the trouble is for the AI, and you, to judge. Titles and names in a repository are written by people, so the AI is told to read them as data, never as instructions.

Apps connected over MCP can read the same with deploys_list and code_repos_list. Connecting a code host and changing links is done in Webalert.

What is kept

For each deploy and merge: the repository, the commit and the one it replaced, the branch, the environment, the status, the times, who did it, the pull request’s number and title, and a link. Kept 90 days.

Never your code: no diffs, no file contents. GitHub signs every event it sends, and Webalert checks the signature before reading it. The deploy webhook’s secret is kept only as a hash.

Plans and roles

Code hosts come with server monitoring, on the Starter and Business plans and during a trial, at no extra price and with no charge per repository. On Free, nothing new is recorded.

  • Owners and admins connect GitHub, add deploy webhooks, link repositories, turn repositories off and remove connections.
  • Members see the code hosts and every deploy and merge.
  • Viewers do not see code hosts.

Removing a code host

Remove on a connection in Settings → Code hosts stops it at once and deletes its repositories, links, deploys and merges in Webalert. For GitHub, also uninstall the Webalert app under your account’s or organization’s Settings → GitHub Apps. If the app is uninstalled on GitHub first, Webalert shows the connection as removed; connecting GitHub again brings it back with its links.

Troubleshooting

  • Merges show but no deploys. The repository deploys without GitHub deployments. Name the workflow that deploys (Workflows that deploy) or send deploys to a deploy webhook.
  • A deploy does not show on a server or incident. Check that the repository is linked to that server, its label, its group or the monitor, and that the link’s environment matches the deploy’s.
  • The deploy webhook answers 401. The address or the secret is wrong. Make a new secret and use it.
  • The deploy webhook answers 409. That service’s Receive deploys switch is off.
  • The deploy webhook answers 422. The body has no service, or a status other than started, succeeded or failed. The answer says which.
  • The deploy webhook answers 402. The account is on Free; code hosts are on Starter and Business.
  • A repository says “No longer shared with Webalert”. It was taken out of the app’s repository access on GitHub. Add it back there.

Anything else: write to us.