-
Notifications
You must be signed in to change notification settings - Fork 3
Description
What is the problem?
The action will parse titles with the format (area) title into an array containing multiple empty strings.
Reproduction Steps
Submit an issue with the format (area) title, and the array of words which will be compared to keywords will be:
['', 'area', '', 'title']
Other Info
I'm not sure why the first empty string appears, but any other empty strings seem to appear when there are at least two characters adjacent to each other which used to split the string returned by the Github API.
This is set here:
aws-issue-triage-manager/src/issue.ts
Lines 26 to 37 in 6936d0a
| if (title) { | |
| excluded.forEach(ex => { | |
| title.replace(ex, ''); | |
| }); | |
| this.titleIssueWords = title.split(/ |\(|\)|\./); | |
| } | |
| if (body) { | |
| excluded.forEach(ex => { | |
| body.replace(ex, ''); | |
| }); | |
| this.bodyIssueWords = body.split(/ |\(|\)|\./); | |
| } |
Additionally, the way punctuation is handled in this action isn't clear and should be more transparent.
It should also be more configurable by the user. Currently, nearly all punctuation is ignored when comparing strings to keywords:
aws-issue-triage-manager/src/issue.ts
Lines 138 to 143 in 6936d0a
| str1 = str1.toLowerCase(); | |
| str2 = str2.toLowerCase(); | |
| // Regex for removing punctuation and replacing with empty string | |
| str1 = str1.replace(/ |_|-|\(|\)|:|\`|\[|\]| |\./gi, ''); | |
| str2 = str2.replace(/ |_|-|\(|\)|:|\`|\[|\]| |\./gi, ''); |