Cross-Repo Duplicate Finder
For each new issue, runs a GitHub search across the whole org for similar open issues and posts a comment listing possible cross-repo duplicates so fixes land once instead of in multiple repos.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow watches for newly opened GitHub issues on any repository you own and scans the entire organization for open issues with similar titles. When it finds candidates, it posts a single consolidated comment on the source issue listing the possible cross-repo duplicates so triage can happen in one place instead of independently in every repo.
Use Case
Engineering orgs that split work across many repos often file the same bug or feature request in multiple places. Nobody notices the overlap until a release manager starts linking issues by hand, by which point two teams have already duplicated investigation. This flow surfaces likely duplicates as the new issue is opened, before engineering picks the work up.
The flow is ideal for teams that:
- Platform teams whose products span multiple repos.
- Plugin or microservice fleets where a logical bug shows up in many places.
- Reduce duplicate investigation cost by linking issues at intake.
- Comment-only — humans stay in the decision loop on whether to close.
Flow Architecture
When a new issue is opened
GitHub IssueOpenedPolls every 15 minutes; trigger body contains the full issue payload (number, title, repository_url).
Init 8 variables
InitializeVariablevarGitHubOrganization, varGitHubApiToken, varMaxResults, varCommentHeader, plus parsed varIssueOwner / varIssueRepo / varIssueNumber / varIssueTitle from the trigger payload.
Search For Possible Duplicates
GitHub SearchIssuesQuery: `org:{org} is:issue is:open in:title {title}`, sort=created, order=desc, per_page=20.
Filter Out Source Issue
Filter arrayDrops the source issue using a coalesce-resilient body accessor.
Check If Duplicates Found
If conditionEvaluates length(filtered array) > 0.
- Select Duplicate Markdown Lines — Builds bullet markdown links capped at varMaxResults.
- Compose Comment Body — Concatenates header, blank lines, and unwrapped Select output.
- Post Duplicate Comment — HTTP POST to /repos/{owner}/{repo}/issues/{number}/comments with bearer auth from env var.
Empty branch — nothing is posted.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_GitHubOrganization | String | aronmb23 | Org slug used to scope the duplicate search (org:{value}). |
| flowlibs_GitHubApiToken | String | — | GitHub PAT used by the HTTP action to post comments. `repo` scope required. |
| flowlibs_GitHubDuplicateMaxResults | Number | 5 | Upper bound on how many duplicate links appear in the comment. |
| flowlibs_GitHubDuplicateCommentHeader | String | 🔍 Possible cross-repo duplicates detected: | First line of the duplicate comment. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| GitHub | shared_github | IssueOpened (trigger) SearchIssues |
| HTTP | shared_http | POST (issues/{n}/comments — connector lacks a CreateComment op) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Point at a different org
- Update flowlibs_GitHubOrganization. No flow changes required.
- Broaden or narrow the search
- Edit the SearchIssues q — drop is:open, add in:title,body, or scope to repo:{owner}/{name}.
- Change the comment format
- Edit flowlibs_GitHubDuplicateCommentHeader for the opening line; modify the Select concat for bullet style.
- Throttle the volume
- Raise or lower flowlibs_GitHubDuplicateMaxResults. Remove the HTTP action to keep search-only.
- Change polling cadence
- Edit the trigger's recurrence (currently 15 minutes). Shorter intervals cost more API calls.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Parse owner from trigger
Splits repository_url on `/` and indexes 4.
EXPR.02Parse repo from trigger
Last segment of repository_url.
EXPR.03Build the org-scoped search query
Used as SearchIssues q parameter.
EXPR.04Defensive body access
Handles both response shapes for SearchIssues.
EXPR.05Cap at varMaxResults
Used by the Select action's `from`.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.