On a schedule
Remind reviewers in Slack about open GitHub pull requests
Each weekday morning, reviewers with pull requests waiting more than a day are mentioned by name in a Slack channel.
- Runs
- On a schedule
- Apps
- GitHub, Slack
- AI
- Not needed
- Access
- Pull requests: read; users:read, users:read.email, chat:write
Send this to your assistant
Create a ClickRuntime automation: every weekday at 10am, find pull requests in acme/app waiting on a reviewer for more than 24 hours and post a reminder to #code-review mentioning each reviewer in Slack.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Pull requests stall most often while waiting for review, and a GitHub email that says "review requested" is easy to miss among dozens of notifications. Authors end up chasing reviewers in chat by hand.
Each weekday this automation lists open pull requests, finds the ones waiting on a requested reviewer for more than a day, and posts one message to your review channel. Each reviewer is mentioned in Slack, with the pull requests they owe and how long each has waited.
Engineering teams use it to keep review time short without a lead having to chase people, and authors stop having to ask for reviews themselves.
What you get out of it
Mentions that notify
Reviewers are tagged by their Slack account, so the reminder reaches them the same way a teammate's message would.
Only stale requests
Pull requests updated in the last 24 hours are left out, so fresh work is not nagged.
Drafts ignored
Draft pull requests are skipped until they are marked ready.
One message, not many
All reminders go into a single post, which keeps the channel readable.
Weekends off
No reminders are sent on Saturday or Sunday.
How it works
What happens, step by step
Each weekday morning the automation lists open pull requests that are not drafts.
For each one it checks who has been asked to review and how long the request has been open.
It matches GitHub users to Slack members by email, or by a mapping you provide.
One message in the review channel mentions each reviewer with the pull requests they owe.
Before it runs live
- Connect GitHub
- Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
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
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Google Sheets
- Combine it with other GitHub and Slack steps into one automation
Under the hood
The code that runs this automation
import datetime
from clickruntime import on_trigger, credentials, http, notify
REPO = "acme/app"
CHANNEL = "#code-review"
HOURS = 24
GH_TO_EMAIL = {"kchen": "kim@acme.com", "vlee": "vik@acme.com"}
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
def slack_id(email):
r = http.get("https://slack.com/api/users.lookupByEmail", params={"email": email},
headers={"Authorization": f"Bearer {credentials.connection('slack', 'work')}"}).json()
return r["user"]["id"] if r.get("ok") else None
@on_trigger
def run(event):
if datetime.datetime.utcnow().weekday() >= 5:
return {"skipped": "weekend"}
now = datetime.datetime.utcnow()
owed = {}
for pr in gh("GET", f"/repos/{REPO}/pulls", params={"state": "open", "per_page": 100}):
if pr["draft"]:
continue
age = now - datetime.datetime.strptime(pr["updated_at"], "%Y-%m-%dT%H:%M:%SZ")
if age.total_seconds() < HOURS * 3600:
continue
for r in pr["requested_reviewers"]:
owed.setdefault(r["login"], []).append(f"{pr['title']} (<{pr['html_url']}|#{pr['number']}>), {age.days or 1} day{'s' if age.days > 1 else ''}")
if not owed:
return {"waiting": 0}
lines = []
for login, prs in owed.items():
uid = slack_id(GH_TO_EMAIL[login]) if login in GH_TO_EMAIL else None
lines.append(f"{f'<@{uid}>' if uid else login}: " + " · ".join(prs))
notify.slack("Pull requests waiting for review:\n" + "\n".join(lines), channel=CHANNEL)
return {"reviewers": len(owed)}FAQ
Common questions
How are GitHub users matched to Slack people?
Does it count time from when the review was requested?
Can it send the reminder as a direct message instead?
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
Back up exports to GitHub each night
Every night your configuration or workflow exports are saved to a GitHub repository, and Slack lists exactly what changed.
See how it worksTrack flaky CI jobs in GitHub Actions
Each morning Slack lists the GitHub Actions workflows that failed and then passed on a re-run in the last week, so you know which tests are flaky.
See how it worksPost a daily engineering digest from GitHub in Slack
Each morning before standup, Slack shows what merged yesterday, which pull requests are waiting for review and which issues were opened.
See how it worksKeep exploring
Set up “Remind reviewers in Slack about open GitHub pull requests” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.