Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

feat: add Issue and PR duplicate detection bot - #1

Merged
0x5t4l1n merged 1 commit into
mainfrom
copilot/add-issue-pr-automation-bot
May 3, 2026
Merged

feat: add Issue and PR duplicate detection bot#1
0x5t4l1n merged 1 commit into
mainfrom
copilot/add-issue-pr-automation-bot

Conversation

Copilot AI commented May 3, 2026

Copy link
Copy Markdown
Contributor

Adds a GitHub Actions workflow that automatically triages new issues and PRs by detecting duplicates using Jaccard keyword similarity and posting contextual comments.

Workflow: .github/workflows/issue-pr-bot.yml

  • Triggers on issues: [opened] and pull_request: [opened]
  • Tokenises title + body — strips punctuation and stop-words to produce a keyword set
  • Computes Jaccard similarity against all existing open issues/PRs; threshold is 0.30
  • Duplicate path: adds duplicate label + comment pointing to the matched item number
  • Non-duplicate path: adds needs-triage label + welcome comment with contribution guidance
  • Both labels are auto-created if absent (idempotent)

Similarity logic

// Jaccard: |A ∩ B| / |A ∪ B|  — returns 0 if either set is empty
function jaccardSimilarity(setA, setB) {
  if (setA.size === 0 || setB.size === 0) return 0;
  const intersection = [...setA].filter(w => setB.has(w)).length;
  return intersection / new Set([...setA, ...setB]).size;
}

All logic runs inside a single actions/github-script@v7 step — no external dependencies or secrets beyond the default GITHUB_TOKEN.

@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown

👋 Hello! Thanks for your contribution. We will review this and get back to you as soon as possible. — th30d4y

@github-actions github-actions Bot added the needs-triage Needs triage by a maintainer label May 3, 2026
@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown

👋 Thanks for opening this Pull Request!

A maintainer will review it shortly. In the meantime:

@0x5t4l1n
0x5t4l1n marked this pull request as ready for review May 3, 2026 13:02
@0x5t4l1n
0x5t4l1n merged commit 93ab069 into main May 3, 2026
2 of 3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-triage Needs triage by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants