Stale PR Reminder
Weekly schedule lists all open PRs older than 7 days, emails each author a personalized Outlook reminder, and CCs the requested reviewer to unblock merges.
Overview
Weekly scheduled flow that hunts down neglected pull requests in a GitHub repository and nudges the author (with CC to a dev-leads list) so review queues keep flowing instead of piling up. Every Monday at 8:00 AM Eastern lists all open PRs, filters down to those whose updated_at is older than the configurable day threshold, and sends a personalized HTML email with PR summary and a polite rebase/update ask.
**State:** Stopped (Off, demo)
Use Case
Engineering teams lose momentum when PRs sit open for weeks with no activity — reviewers forget context, branches drift behind main, merge conflicts compound. Rather than relying on chat nudges, this flow automates the courtesy reminder on a predictable weekly cadence.
**Key Benefits:** personalized (author name, specific PR, exact days stale) feels less like spam; dev leads CC for visibility/escalation.
Flow Architecture
Trigger: **Weekly Schedule Monday 8am** (Recurrence). 1. Init 6 vars (owner, repo, threshold, CC, author domain, stale cutoff = `addDays(utcNow(), -threshold)`) 2. **Get Open Pull Requests** (GitHub GetPullRequests sorted by updated asc, per_page=100) 3. **For Each Pull Request** - Check If Pull Request Is Stale (If: `updated_at < varStaleCutoffUtc`) - Send Stale PR Reminder Email (Outlook SendEmailV2 with author CC dev-leads)
Environment Variables
| Variable | Schema Name | Type | Default | Purpose |
|---|---|---|---|---|
| GitHub Owner | flowlibs_GitHubOwner | String | aronhomelab | GitHub owner |
| GitHub Repository | flowlibs_GitHubRepository | String | flowlibs-demo | Repository name |
| Stale PR Days Threshold | flowlibs_StalePrDaysThreshold | String | 7 | Days threshold (cast to int) |
| PR Reminder CC Email | flowlibs_PrReminderCcEmail | String | devleads@aronco.com | CC for reminder emails |
| PR Author Email Domain | flowlibs_PrAuthorEmailDomain | String | aronhomelab.com | Domain for resolving GitHub login → email |
Connectors & Connections
| Connector | API Name | Connection Format | Usage |
|---|---|---|---|
| GitHub | shared_github | b2585b1b8da6406cbb41ba7c48f66af5 | GetPullRequests — lists open PRs |
| Office 365 Outlook | shared_office365 | shared-office365-ab123aff-... | SendEmailV2 — personalized reminder |
Customization Guide
1. Set 5 env vars (owner, repo, threshold, CC, author domain).
2. Update connection refs (GitHub PAT, Outlook).
3. Turn on.
**Common Modifications:** adjust threshold (3 = aggressive, 14 = lenient); route CC to different list; replace email domain mapping with Office 365 Users SearchUser; change schedule (timezone, weekDays); scale beyond 100 PRs via Do-Until + page increment.
Key Expressions
- addDays(utcNow(), mul(-1, variables('varStalePrDaysThreshold'))) — stale cutoff
- less(items('For_Each_Pull_Request')?['updated_at'], variables('varStaleCutoffUtc')) — staleness check
- concat(items('For_Each_Pull_Request')?['user']?['login'], '@', variables('varPrAuthorEmailDomain')) — author email resolution