From 89f186308bcfb738caf76e2ad3c35e19b40736ee Mon Sep 17 00:00:00 2001 From: Inga Lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Wed, 21 Dec 2016 18:37:58 +0300 Subject: [PATCH] Limited maximum comment length --- BuildServer/lib/commenter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BuildServer/lib/commenter.js b/BuildServer/lib/commenter.js index a8aa1a3..23a1297 100644 --- a/BuildServer/lib/commenter.js +++ b/BuildServer/lib/commenter.js @@ -186,7 +186,7 @@ const getStatusMessageFromRelease = (app, options, callback) => { exports.commentOnPullRequest = (options, callback) => { options.github = settings.createGithub(options.baseRepoOptions.owner); return checkPullRequest(options, (err, successMessage) => getStatusMessageFromRelease(options.app, options.headRepoOptions, (err, successMessage) => { - const message = err ? ("Was not built:\r\n\r\n```\r\n" + err.replace(/```/g, "` ` `") + "\r\n```\r\n\r\nDO NOT MERGE!") : ("Build OK\r\n\r\n" + successMessage); + const message = err ? ("Was not built:\r\n\r\n```\r\n" + err.substring(0, 64000).replace(/```/g, "` ` `") + "\r\n```\r\n\r\nDO NOT MERGE!") : ("Build OK\r\n\r\n" + successMessage); const statusUrlMessage = "Build status URL: " + settings.siteRoot + "status/" + options.headRepoOptions.owner + "/" + options.headRepoOptions.reponame + "/" + options.headRepoOptions.rev + "\r\n\r\n"; return writeComment(options, message + "\r\n\r\n" + statusUrlMessage, callback); }));