🔎 Search for potential issue duplicates using Damerau–Levenshtein algorithm and close them
Go to file
2023-06-03 12:46:49 +02:00
.github/workflows add ability to automatically close the issue 2023-06-03 12:46:49 +02:00
.husky chore: 🛠️ git hooks 2021-09-21 11:00:45 +08:00
src add ability to automatically close the issue 2023-06-03 12:46:49 +02:00
.editorconfig perf: ️ init 2020-09-27 21:29:47 +08:00
.eslintrc ci: 👷 tslint => eslint 2021-09-21 11:00:27 +08:00
.gitignore perf: ️ init 2020-09-27 21:29:47 +08:00
.prettierignore perf: ️ init 2020-09-27 21:29:47 +08:00
.prettierrc perf: ️ init 2020-09-27 21:29:47 +08:00
action.yml chore: 🔧 running action on Node16 2022-10-17 11:08:43 +08:00
LICENSE Initial commit 2020-09-27 14:16:24 +08:00
package.json add ability to automatically close the issue 2023-06-03 12:46:49 +02:00
README.md add ability to automatically close the issue 2023-06-03 12:46:49 +02:00
tsconfig.json perf: ️ init 2020-09-27 21:29:47 +08:00
yarn.lock refactor: ♻️ update deps 2021-09-21 11:01:01 +08:00

Potential Duplicates

build MIT License Language PRs Welcome website Language grade: JavaScript

Search for potential issue duplicates using DamerauLevenshtein algorithm and close it.

Usage

Create .github/workflows/close-potential-duplicates.yml in the default branch:

name: Potential Duplicates
on:
  issues:
    types: [opened, edited]
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: iv-org/close-potential-duplicates@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          # Issue title filter work with anymatch https://www.npmjs.com/package/anymatch.
          # Any matched issue will stop detection immediately.
          # You can specify multi filters in each line.
          filter: ''
          # Exclude keywords in title before detecting.
          exclude: ''
          # Label to set, when potential duplicates are detected.
          label: potential-duplicate
          # Get issues with state to compare. Supported state: 'all', 'closed', 'open'.
          state: all
          # If similarity is higher than this threshold([0,1]), issue will be marked as duplicate.
          threshold: 0.6
          # Reactions to be add to comment when potential duplicates are detected.
          # Available reactions: "-1", "+1", "confused", "laugh", "heart", "hooray", "rocket", "eyes"
          reactions: 'eyes, confused'
          # Close or not the issue: false or true
          close: 'false'
          # Comment to post when potential duplicates are detected.
          comment: >
            Potential duplicates: {{#issues}}
              - [#{{ number }}] {{ title }} ({{ accuracy }}%)
            {{/issues}}            

Inputs

Various inputs are defined to let you configure the action:

Note: Workflow command and parameter names are not case-sensitive.

Name Description Default
GITHUB_TOKEN The GitHub token for authentication N/A
filter Issue title filter work with anymatch
Any matched issue will stop detection immediately
You can specify multi filters in each line
''
exclude Exclude keywords in title before detecting ''
label Label to set, when potential duplicates are detected 'potential-duplicate'
state Get issues with state to compare. Supported state: 'all' 'closed' 'open' 'all'
threshold If similarity is higher than this threshold([0,1]), issue will be marked as duplicate 0.6
reactions Reactions to be add to comment when potential duplicates are detected
Available reactions: "-1", "+1", "confused", "laugh", "heart", "hooray", "rocket", "eyes"
comment Comment to post when potential duplicates are detected 👇
close Close or not the issue when found to be duplicate. false

Available reactions:

content emoji
+1 👍
-1 👎
laugh 😄
confused 😕
heart ❤️
hooray 🎉
rocket 🚀
eyes 👀

Default comment:

Potential duplicates: {{#issues}}
  - [#{{ number }}] {{ title }} ({{ accuracy }}%)
{{/issues}}

License

The scripts and documentation in this project are released under the MIT License