Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: truncate body when it exceeds the max length #182

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ function appendSeparatorTo(body, separator) {
}
function createComment(octokit, owner, repo, issueNumber, body) {
return __awaiter(this, void 0, void 0, function* () {
// 65536 characters is the maximum allowed for issue comments.
if (body.length > 65536) {
core.warning(`Comment body is too long. Truncating to 65536 characters.`);
body = body.substring(0, 65536);
}
const { data: comment } = yield octokit.rest.issues.createComment({
owner: owner,
repo: repo,
Expand Down