Skip to content

Commit

Permalink
fix: handle comment limitation and error (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
bokuweb authored Nov 9, 2024
1 parent d75346c commit 4d525ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ ${successOrFailMessage}
${report}
`;

return body;
// maximum is 65536 characters
return body.slice(0, 65536);
};

export const createCommentWithoutTarget = ({
Expand All @@ -220,5 +221,6 @@ ${report}
| new | ${result.newItems.length} |
`;

return body;
// maximum is 65536 characters
return body.slice(0, 65536);
};
6 changes: 5 additions & 1 deletion src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ export const run = async ({
artifactName: config.artifactName,
customReportPage: config.customReportPage,
});
await client.postComment(event.number, comment);
try {
await client.postComment(event.number, comment);
} catch(e) {
log.warn(`Failed to postComment, reason ${e}`);
}
}
return;
}
Expand Down

0 comments on commit 4d525ae

Please sign in to comment.