-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameters to excludes custom words #14
Comments
filter newly created issue by title, any matched issue would not go on detection re #14
@service-paradis |
@bubkoo Thanks for your work and the follow up! This is an examples.
I would like the algo to exclude a custom list of words before comparing the title. For example, having something like:
|
@service-paradis config like this jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: bubkoo/potential-duplicates@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
filter: 'Request ** icon' |
Thanks again @bubkoo 😄
|
@service-paradis You can specify multi filters in each line, such as jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: bubkoo/potential-duplicates@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
filter: |
Request ** icon
Add ** icon
** icon **
** Ubuntu ** |
Sorry @bubkoo, but this is not what we need. If I'm not mistaken, when an issue is opened, if match with, at least, one filter (if their title is "valid") will not be checked for potential duplicates. We need that, regardless of the opened issue title (without "validate it"), remove from it the words that are not needed and, comparing with other titles, of these other titles would be also removed certain words to improve the match between titles. As @service-paradis pointed, we need an "exclude" function. Is something that you plan to include or not? |
replace keyworlds with empty string re #14
@mondeja @service-paradis Keyworlds specified in jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: bubkoo/potential-duplicates@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
exclude: |
request
icon
add
ubuntu |
What about remove them instead of replacing with empty strings? Empty strings will be compared also, increasing the possibility of false positives. Check this test, the action is comparing |
Empty strings will be compared also, increasing the possibility of false positives. re #14
Thanks again for your work on this @bubkoo Unfortunately, I dont think the changes you made will totally solve the previous problem with unnecessary spaces. For example, if we want to exclude "Request" and "icon" from "Request Ubuntu icon" before: .reduce((memo, keyworld) => memo.replace(keyworld, ' '), title) gives after .reduce((memo, keyworld) => memo.replace(keyworld, ''), title)
.replace(/\s+/, ' ') gives For the comparison, you are creating arrays using Maybe trimming leading and trailing spaces before splitting would solve the above. |
@service-paradis It now will trimming leading and trailing spaces before return. export function formatTitle(title: string) {
const exclude = core.getInput('exclude')
if (exclude) {
return exclude
.split(/[\s\n]+/)
.map((keyworld) => keyworld.trim())
.filter((keyworld) => keyworld.length > 0)
.reduce((memo, keyworld) => memo.replace(keyworld, ''), title)
.replace(/\s+/, ' ')
.trim()
}
return title
} |
Would it makes sense to make the list of excluded words case insensitive? (Also, |
add `nocase` option for anymatch re #14
@service-paradis Thanks for your tips and suggestions. |
remove matched keywords from title re #14
# 1.0.0 (2023-06-03) ### Bug Fixes * 🐛 Avoid false positives if issue title is empty after excluding ([wow-actions#20](https://github.com/iv-org/close-potential-duplicates/issues/20)) ([e58dfb2](e58dfb2)) * 🐛 Exclude pull requests searching for duplicates ([wow-actions#19](https://github.com/iv-org/close-potential-duplicates/issues/19)) ([eebe64d](eebe64d)) * 🐛 excluded words should be case insensitivity ([f6ebc6e](f6ebc6e)), closes [wow-actions#14](https://github.com/iv-org/close-potential-duplicates/issues/14) * 🐛 remove matched keywords ([0d07e57](0d07e57)), closes [wow-actions#14](https://github.com/iv-org/close-potential-duplicates/issues/14) * 🐛 trimming leading and trailing spaces in issue title ([e0aa68f](e0aa68f)), closes [wow-actions#12](https://github.com/iv-org/close-potential-duplicates/issues/12) * 🐛 typos ([393ab50](393ab50)), closes [wow-actions#14](https://github.com/iv-org/close-potential-duplicates/issues/14) * 🐛 typos ([2bfd89d](2bfd89d)) ### Features * ✨ exclude keyworlds in title before detecting ([6f12b76](6f12b76)), closes [wow-actions#14](https://github.com/iv-org/close-potential-duplicates/issues/14) * ✨ issue title filter ([7f95e44](7f95e44)), closes [wow-actions#14](https://github.com/iv-org/close-potential-duplicates/issues/14) * ✨ make the list of excluded words case insensitive ([8dde4ad](8dde4ad)), closes [wow-actions#14](https://github.com/iv-org/close-potential-duplicates/issues/14) * ✨ support multi line filters ([4e8f2cd](4e8f2cd)) * ✨ support reactions ([9908687](9908687)) ### Performance Improvements * ⚡️ init ([05eddff](05eddff))
Thanks for this action!
I would like to use something similar for https://github.com/simple-icons/simple-icons
It would be really beneficial if we could filter some words of the algo. For example, we have a lot of request that looks like
Request: brandname icon
. There would be a lot of false positive if we use your action as-is. But if we could exclude specific words likeRequest
andicon
, it could probably be able to catch a good amount of duplicate.The text was updated successfully, but these errors were encountered: