Skip to content

Commit

Permalink
fix: truncate body when it exceeds the max length (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans committed May 2, 2023
1 parent 3518fea commit ca08ebd
Show file tree
Hide file tree
Showing 3 changed files with 3,522 additions and 1,607 deletions.
5 changes: 5 additions & 0 deletions dist/index.js
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

0 comments on commit ca08ebd

Please sign in to comment.