Skip to content

Commit 740dcfd

Browse files
committed
#2397: limit maximum length of clang-format output
1 parent 97c58c6 commit 740dcfd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/run-clang-format.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ jobs:
3838
3939
const fs = require("fs").promises
4040
var output = await fs.readFile("clang-format.diff")
41-
const commentBody = '`clang-format` output for this changeset:\n```diff\n' + output + '\n```'
41+
// make sure not to exceed maximum length of the comment
42+
output = (output.length > 65000) ?
43+
output.substring(0, 65000) + '\n(...)' : output
44+
const commentBody =
45+
'`clang-format` output for this changeset:\n```diff\n' +
46+
output + '\n```'
47+
4248
if (commentId === -1) {
4349
await github.rest.issues.createComment({
4450
owner: context.repo.owner,

0 commit comments

Comments
 (0)