Giter Site home page Giter Site logo

01x4-dev / ghidd Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 28 KB

GitHub Issues Duplicate Detector πŸ” | AI-powered 🧠

Home Page: https://github.com/marketplace/actions/github-issue-duplicate-detector

License: GNU General Public License v3.0

Dockerfile 8.81% Python 91.19%
github-actions github-api issue-management openai-api

ghidd's Introduction

GitHub Issues Duplicate Detector πŸ” | AI-powered 🧠

ghidd (pronounced [Ι‘Ιͺd], standing as the acronym of the above) is an action exploiting latest NLP platform gpt-4o-mini from OpenAI to understand GitHub issue's context and contents for detecting if could be a duplicate of any already existing issue(s) in your repository.


❗Pre-requisites

You shall already have signed up for an OpenAI account and have generated a valid API key.

⚠️ Notes

It's recommended to set API spending limit in your OpenAI API profile to clamp associated costs. API calls in the code are already fairly optimized to minimize both input and output tokens, driving overall cost:

  • context (input) tokens by accurate prompting and trimming excessively verbose issue text bodies
  • generated (output) tokens by accurate role playing and reasoning guidance leading to telegram-style response

πŸ““ How to use it

ghidd requires you to set up a few items first:

  1. Go to your repository settings > secrets and variables > actions and create new repository secret called OPENAI_API_KEY (case sensitive, do not name differently) with your user's API key as its secret value. Save it.
  2. Create workflow .yml file in your repository to trigger action execution. Boilerplate below can be used as example:
name: Check duplicate issues in repository

on:
  issues:
    types:
      - opened

permissions:
  contents: read
  issues: write
  pull-requests: write

jobs:
  check-duplicate-repo-issues:
    runs-on: ubuntu-latest
    steps:
      - name: Run public action
        uses: 01x4-dev/ghidd@v0
        id: run-action
        with:
          mode: 'new'
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          PAT: ${{ secrets.GITHUB_TOKEN }}
          OWNER_REPO: ${{ github.repository }}

      - name: Handle output for optional use
        id: use-output
        run: echo ${{ steps.run-action.outputs.duplicates-found }} duplicates found
  1. Set action's inputs under the with: workflow clause to best fit your needs:
Inputs Description Default Value
mode Operating mode. all or new respectively for cross checking for duplicates all existing issues or just the newly created issue. The first is recommended to make a first pass through all existing open issues and spot any candidate duplicate. Then you can switch to the latter mode to focus only on newly created issues from there on. all
duplCmtH Header to identify bot comment of duplicate issue found > [!WARNING]\n> :robot: **_duplicate issue detected_** :robot:
duplLabel Repo label to tag duplicate issues with, described as JSON string following GitHub API specs { "name": "duplicate", "description": "This issue or pull request already exists", "color": "d93f0b" }

✨ Upon creating a new issue, action will be triggered to run automatically.

βœ”οΈ If duplicate issue is identified, a notification comment is added to them accordingly.


How to use privately (i.e. local fork) If desired, you can run the action locally upon changing your workflow file following the example below.
name: Check duplicate repo issues in repository

on:
  issues:
    types:
      - opened

permissions:
  contents: read
  issues: write
  pull-requests: write

jobs:
  check-duplicate-repo-issues:
    runs-on: ubuntu-latest
    steps:
      # To use this repository's private action you must check out the repository
      - name: Checkout repo contents
        id: checkout-repo
        if: ${{ always() }}
        uses: actions/checkout@v4

      - name: Run action in root directory
        uses: ./
        id: run-action
        with:
          mode: 'new'
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          PAT: ${{ secrets.GITHUB_TOKEN }}
          OWNER_REPO: ${{ github.repository }}

      - name: Handle output for optional use
        id: use-output
        run: echo ${{ steps.run-action.outputs.duplicates-found }} duplicates found

ghidd's People

Contributors

01x4-dev avatar

Stargazers

 avatar

Watchers

 avatar

ghidd's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.