Skip to content

Commit

Permalink
[v 0.3.19]: new release of i18n-action
Browse files Browse the repository at this point in the history
  • Loading branch information
inlang-bot committed Jul 1, 2024
1 parent 089bacb commit ee7f131
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -63278,41 +63278,39 @@ ${lintSummary.map(
});
if (issue.data.locked)
return console.debug("PR is locked, comment is skipped");
const existingComment = await octokit.rest.issues.listComments({
const existingComments = await octokit.rest.issues.listComments({
owner,
repo,
issue_number: prNumber
});
if (existingComment.data.length > 0) {
const commentId = existingComment.data.find(
(comment) => (comment.body?.includes(commentMergeline) || comment.body?.includes(commentResolved)) && comment.user?.login === "github-actions[bot]"
)?.id;
if (commentId) {
console.debug("Updating existing comment");
if (results.every((result) => result.commentContent.length === 0)) {
console.debug("Reports have been fixed, updating comment");
const comment = await octokit.rest.issues.updateComment({
owner,
repo,
comment_id: commentId,
body: commentResolved,
as: "ninja-i18n"
});
if (comment) {
console.debug("Comment updated:\n", comment?.data?.body);
}
} else {
console.debug("Reports have not been fixed, updating comment");
const comment = await octokit.rest.issues.updateComment({
owner,
repo,
comment_id: commentId,
body: commentContent,
as: "ninja-i18n"
});
if (comment) {
console.debug("Comment updated:\n", comment?.data?.body);
}
const ninjaCommentId = existingComments.data.find(
(comment) => (comment.body?.includes(commentMergeline) || comment.body?.includes(commentResolved)) && comment.user?.login === "github-actions[bot]"
)?.id;
if (ninjaCommentId) {
console.debug("Updating existing comment");
if (results.every((result) => result.commentContent.length === 0)) {
console.debug("Reports have been fixed, updating comment");
const comment = await octokit.rest.issues.updateComment({
owner,
repo,
comment_id: ninjaCommentId,
body: commentResolved,
as: "ninja-i18n"
});
if (comment) {
console.debug("Comment updated:\n", comment?.data?.body);
}
} else {
console.debug("Reports have not been fixed, updating comment");
const comment = await octokit.rest.issues.updateComment({
owner,
repo,
comment_id: ninjaCommentId,
body: commentContent,
as: "ninja-i18n"
});
if (comment) {
console.debug("Comment updated:\n", comment?.data?.body);
}
}
} else if (results.every((result) => result.commentContent.length === 0)) {
Expand Down

0 comments on commit ee7f131

Please sign in to comment.