New to Kestra?
Use blueprints to kickstart your first workflows.
On a new GitHub issue, Kestra loads recent keyword matches and comments when a model calls one a duplicate.
When a GitHub issue is opened, this flow searches for recent open issues with similar titles, fetches their bodies, and uses AI to determine whether one describes the same bug. If a duplicate is detected, the flow comments on the new issue with the matching issue and explanation.
The four inputs are only for a manual test. A webhook run reads the issue from trigger.body. A manual execution has no trigger, so the first If treats that as a test run and the issue task reads the inputs.
GitHub search can lag a minute after an issue is created, so the first webhook run may find no candidates even when a duplicate exists. A title that contains quotes, colons, or # can also make the search query invalid.
GITHUB_TOKEN: token with permission to search issues, read issue bodies, and post comments.GITHUB_WEBHOOK_KEY: secret embedded in the webhook URL so only GitHub can start the flow.OPENAI_API_KEY: key for the gpt-4o-mini ChatCompletion call.outputs.verdict.values.duplicate: true when the model calls one candidate the same bug.outputs.verdict.values.issue_number: matching issue number, or 0 when nothing matches.outputs.verdict.values.title: title of the matching issue.outputs.verdict.values.reason: one-line explanation posted in the comment.These outputs exist only when at least one other recent open issue matched the title search. Otherwise the flow logs that no candidates were found.
repository, issue_number, issue_title, and issue_body to a real open issue.opened events.