Skip to content

Commit

Permalink
fix: similarity accuracy again
Browse files Browse the repository at this point in the history
  • Loading branch information
xrkffgg committed Apr 19, 2022
1 parent 20737dd commit 7802187
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v1.1.2

`2022.04.19`

- fix: similarity accuracy again.

## v1.1.1

`2022.04.17`
Expand Down
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10150,16 +10150,17 @@ async function doIssueComment(owner, repo, number, issues, commentTitle, comment
const title = commentTitle || `### Issues Similarity Analysis:`;
let body = '';
issues.forEach((iss, index) => {
const similarity = (iss.similarity * 100).toString().substring(0, 2);
if (commentBody) {
let temp = commentBody;
temp = temp.replace('${number}', iss.number);
temp = temp.replace('${title}', iss.title);
temp = temp.replace('${similarity}', iss.similarity * 100 + '%');
temp = temp.replace('${similarity}', similarity + '%');
temp = temp.replace('${index}', index + 1);
body += `${temp}
`;
} else {
body += `- [#${iss.number}][${iss.title}][${iss.similarity * 100 + '%'}]
body += `- [#${iss.number}][${iss.title}][${similarity}%]
`;
}
});
Expand Down
5 changes: 3 additions & 2 deletions src/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,17 @@ async function doIssueComment(owner, repo, number, issues, commentTitle, comment
const title = commentTitle || `### Issues Similarity Analysis:`;
let body = '';
issues.forEach((iss, index) => {
const similarity = (iss.similarity * 100).toString().substring(0, 2);
if (commentBody) {
let temp = commentBody;
temp = temp.replace('${number}', iss.number);
temp = temp.replace('${title}', iss.title);
temp = temp.replace('${similarity}', iss.similarity * 100 + '%');
temp = temp.replace('${similarity}', similarity + '%');
temp = temp.replace('${index}', index + 1);
body += `${temp}
`;
} else {
body += `- [#${iss.number}][${iss.title}][${iss.similarity * 100 + '%'}]
body += `- [#${iss.number}][${iss.title}][${similarity}%]
`;
}
});
Expand Down

0 comments on commit 7802187

Please sign in to comment.