Skip to content

Commit ca08ebd

Browse files
authored
fix: truncate body when it exceeds the max length (#182)
1 parent 3518fea commit ca08ebd

File tree

3 files changed

+3522
-1607
lines changed

3 files changed

+3522
-1607
lines changed

dist/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ function appendSeparatorTo(body, separator) {
130130
}
131131
function createComment(octokit, owner, repo, issueNumber, body) {
132132
return __awaiter(this, void 0, void 0, function* () {
133+
// 65536 characters is the maximum allowed for issue comments.
134+
if (body.length > 65536) {
135+
core.warning(`Comment body is too long. Truncating to 65536 characters.`);
136+
body = body.substring(0, 65536);
137+
}
133138
const { data: comment } = yield octokit.rest.issues.createComment({
134139
owner: owner,
135140
repo: repo,

0 commit comments

Comments
 (0)