Every 5 minutes
Get alerted when a build fails on main
When a GitHub Actions run fails on main, you get a Slack message with the link within minutes.
- Runs
- Every 5 minutes
- Apps
- GitHub
- AI
- Not needed
- Access
- Actions: read
Send this to your assistant
Create a ClickRuntime automation: every 5 minutes, check GitHub Actions runs on the main branch of acme/app and post any failed run to #builds in Slack with the workflow name, commit and link.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A broken main branch costs the whole team. Someone merges a pull request on Friday afternoon, the GitHub Actions workflow fails on a flaky migration test, and nobody notices because the email notification went to the person who already left. Over the weekend more commits stack on top of a red build, and Monday starts with a hunt for which change broke it.
Every 5 minutes workflow runs with status failure are listed, narrowed to the main branch, and any that have not been announced are sent to Slack with the workflow name, branch, commit message and a link to the run. Each failure is remembered, so a run is posted exactly once.
It is helpful for any team that deploys from main and for maintainers who cannot watch the Actions tab all day. Pairing it with the pull request alerts gives a complete picture of repository activity.
What you get out of it
Broken builds are fixed while fresh
The author of the failing change is still online and remembers what they touched, so the fix is often a five-minute revert instead of a Monday investigation. Rolling it back immediately keeps everyone else unblocked.
Deploys stop on top of failures
Knowing main is red means nobody merges a further change or releases a build that was never green, which protects production from changes nobody tested. That saves hours of confusion in a busy repository.
The right people see it
A channel post reaches the whole team instead of one inbox, and someone covering for a colleague on leave still gets the failure notice. Vacation and sick days no longer leave a red build unnoticed.
Each failure is one message
Remembering announced runs avoids a stream of repeats when a workflow is re-run, so the channel stays quiet enough that people read every post. Alerts that people trust get read, while noisy ones get muted.
Links go straight to the logs
The message links to the failed run, so the person responding opens the log in one click instead of navigating through the repository to find it. That saves precious minutes during an incident.
How it works
What happens, step by step
Every five minutes, ClickRuntime checks your GitHub Actions runs on main for failures.
It skips failures it has already reported.
Each new failure is posted to your Slack channel with the commit and a link to the run.
Before it runs live
- Connect GitHub
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other GitHub steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, http, state, notify, report_fetched
def gh(method, path, **kw):
resp = http.request(method, f"https://api.github.com{path}", headers={
"Authorization": f"Bearer {credentials.connection('github', 'work')}",
"Accept": "application/vnd.github+json"}, **kw)
resp.raise_for_status()
return resp.json() if resp.content else None
REPO = "acme/app"
@on_trigger
def run(event):
runs = gh("GET", f"/repos/{REPO}/actions/runs", params={"branch": "main", "status": "failure", "per_page": 20})["workflow_runs"]
seen = set(state.get("seen") or [])
new = [r for r in runs if r["id"] not in seen]
report_fetched(len(new))
if not new:
return {"posted": 0}
for r in new:
notify.slack(f":x: {r['name']} failed on main · {r['head_sha'][:7]} {r['head_commit']['message'].splitlines()[0]}\n"
f"{r['html_url']}", channel="#builds")
state.set("seen", sorted(seen | {r["id"] for r in new})[-500:])
return {"posted": len(new)}FAQ
Common questions
Does it only watch the main branch?
What happens if a failed run is re-run and passes?
Which GitHub token is required to read Actions runs?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Assign new issues automatically
New issues get an owner based on their label, and anyone can take an issue by commenting /assign.
See how it worksGet a Slack message for every new issue
Each new issue on your repo shows up in Slack with its title, author and link.
See how it worksGet pinged when a pull request is opened
You hear about each new pull request within minutes of it being opened.
See how it worksKeep exploring
Set up “Get alerted when a build fails on main” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.