Skip to content

Commit 7802187

Browse files
committed
fix: similarity accuracy again
1 parent 20737dd commit 7802187

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v1.1.2
4+
5+
`2022.04.19`
6+
7+
- fix: similarity accuracy again.
8+
39
## v1.1.1
410

511
`2022.04.17`

dist/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10150,16 +10150,17 @@ async function doIssueComment(owner, repo, number, issues, commentTitle, comment
1015010150
const title = commentTitle || `### Issues Similarity Analysis:`;
1015110151
let body = '';
1015210152
issues.forEach((iss, index) => {
10153+
const similarity = (iss.similarity * 100).toString().substring(0, 2);
1015310154
if (commentBody) {
1015410155
let temp = commentBody;
1015510156
temp = temp.replace('${number}', iss.number);
1015610157
temp = temp.replace('${title}', iss.title);
10157-
temp = temp.replace('${similarity}', iss.similarity * 100 + '%');
10158+
temp = temp.replace('${similarity}', similarity + '%');
1015810159
temp = temp.replace('${index}', index + 1);
1015910160
body += `${temp}
1016010161
`;
1016110162
} else {
10162-
body += `- [#${iss.number}][${iss.title}][${iss.similarity * 100 + '%'}]
10163+
body += `- [#${iss.number}][${iss.title}][${similarity}%]
1016310164
`;
1016410165
}
1016510166
});

src/public.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,17 @@ async function doIssueComment(owner, repo, number, issues, commentTitle, comment
4444
const title = commentTitle || `### Issues Similarity Analysis:`;
4545
let body = '';
4646
issues.forEach((iss, index) => {
47+
const similarity = (iss.similarity * 100).toString().substring(0, 2);
4748
if (commentBody) {
4849
let temp = commentBody;
4950
temp = temp.replace('${number}', iss.number);
5051
temp = temp.replace('${title}', iss.title);
51-
temp = temp.replace('${similarity}', iss.similarity * 100 + '%');
52+
temp = temp.replace('${similarity}', similarity + '%');
5253
temp = temp.replace('${index}', index + 1);
5354
body += `${temp}
5455
`;
5556
} else {
56-
body += `- [#${iss.number}][${iss.title}][${iss.similarity * 100 + '%'}]
57+
body += `- [#${iss.number}][${iss.title}][${similarity}%]
5758
`;
5859
}
5960
});

0 commit comments

Comments
 (0)