Most build notifications are ignored within a fortnight, because they fire constantly and say nothing useful. A good one is quiet, specific, and directed at the right person.

1. Only notify on state changes

The single most important rule. Notify when a build goes from passing to failing, or failing to passing. Not on every successful build.

A channel that receives forty "build passed" messages a day is a channel nobody reads, and the one failure gets scrolled past.

build-notifier.txt
Build a CI notifier for <GitHub Actions / GitLab CI> posting to
<Slack / Discord>.

- Notify only on state change: pass to fail, fail to pass. Silent
  when a passing build passes again.
- On failure include: which job, which step, the last 20 lines of
  relevant output, who pushed, and a direct link to the run.
- On recovery: a short message saying it's fixed and by which commit.
- Group repeated failures of the same job — one message with a count,
  not one per run.
- Handle the notification failing without failing the build.

Webhook URL from a secret, never in the workflow file.

2. Include the actual error

A message saying "build failed" makes someone open a browser, find the run, expand the right section, and scroll. Include the relevant output in the message and they diagnose it from their phone.

Extracting "the relevant output" means finding the failing step and taking the last lines of it, not dumping the whole log.

3. Direct it at a person

Mention whoever pushed the commit. Not the whole channel — that's how notifications get muted. The person who broke it is the person who can fix it, and usually they'd rather know immediately.

4. Recovery matters

Post when it's fixed. Without it, a channel full of failure messages gives no sense of current state, and people stop trusting that a message means anything is actually broken now.

5. Never let it fail the build

The notification step must not be able to break the pipeline. A Slack outage failing your deploy is an absurd and entirely avoidable failure mode. Wrap it, catch everything, continue.

If people mute the channel, the notifier is wrong, not the people. Reduce the volume rather than asking them to unmute.