- Notifications
You must be signed in to change notification settings - Fork3
GitHub Action to detect duplicate issues.
License
pelikhan/action-genai-issue-dedup
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This action is designed to find duplicate issues in a GitHub repository using a GenAI model. It retrieves the current issue and compares it against other issues in the repository, leveraging LLM reasoning to determine if they are duplicates.
Note
This action usesGitHub Models for LLM inference.
The deduplication algorithm implemented ingenaisrc/action.genai.mts
operates as follows:
Issue Retrieval: The script retrieves the current issue and a configurable set of other issues from the repository, filtered by state, labels, creation date, and count. The current issue is excluded from the comparison set.
Batch detection using small LLM: For each group of issues, the script constructs a prompt that defines the current issue and the group of other issues (grouped to fit in the context window). The prompt instructs thesmall LLM to compare the current issue against each candidate, providing a CSV output with the issue number, reasoning, and a verdict (
DUP
for duplicate,UNI
for unique).Single duplicate validation using large LLM: If the LLM identifies duplicates, the script runs a validation LLM prompt using alarge model to confirm the duplicate hit.
Result Output: If duplicates are found, their issue numbers and titles are output. If no duplicates are found, the action is cancelled with an appropriate message.
count
: Number of issues to check for duplicates (default:30
)since
: Only check issues created after this date (ISO 8601 format)labels
: List of labels to filter issues bystate
: State of the issues to check (open, closed, all) (default:open
)max_duplicates
: Maximum number of duplicates to check for (default:3
)tokens_per_issue
: Number of tokens to use for each issue when checking for duplicates (default:1000
)label_as_duplicate
: Addduplicate
label to issues that are found to be duplicates (default:false
)github_token
: GitHub token withmodels: read
permission at least (https://microsoft.github.io/genaiscript/reference/github-actions/#github-models-permissions). (required)debug
: Enable debug logging (https://microsoft.github.io/genaiscript/reference/scripts/logging/).
Add the following to your step in your workflow file:
---permissions:models:readissues:write---steps: -uses:pelikhan/action-genai-issue-dedup@v0with:github_token:${{ secrets.GITHUB_TOKEN }}
Save this file under.github/workflows/genai-issue-dedup.yml
in your repository:
name:GenAI Find Duplicate Issueson:issues:types:[opened, reopened]permissions:models:readissues:writeconcurrency:group:${{ github.workflow }}-${{ github.event.issue.number }}cancel-in-progress:truejobs:genai-issue-dedup:runs-on:ubuntu-lateststeps: -name:Run action-issue-dedup Actionuses:pelikhan/action-genai-issue-dedup@v0with:github_token:${{ secrets.GITHUB_TOKEN }}
This action was automatically generated by GenAIScript from the script metadata.We recommend updating the script metadata instead of editing the action files directly.
- the action inputs are inferred from the script parameters
- the action outputs are inferred from the script output schema
- the action description is the script title
- the readme description is the script description
- the action branding is the script branding
Toregenerate the action files (action.yml
), run:
npm run configure
To lint script files, run:
npm run lint
To typecheck the scripts, run:
npm run typecheck
To build the Docker image locally, run:
npm run docker:build
To run the action locally in Docker (build it first), use:
npm run docker:start
To run the action usingact, first install the act CLI:
npm run act:install
Then, you can run the action with:
npm run act
The GenAIScript version is pinned in thepackage.json
file. To upgrade it, run:
npm run upgrade
To release a new version of this action, run the release script on a clean working directory.
npm run release
About
GitHub Action to detect duplicate issues.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.