From 2ffd867f2559cdad9581c889605f3c1d404eef02 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sun, 29 Jan 2023 14:43:38 -0500 Subject: [PATCH] Increase `mypy_primer` comment length (#9598) --- .github/workflows/mypy_primer_comment.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mypy_primer_comment.yml b/.github/workflows/mypy_primer_comment.yml index 172bb9cfb..0be8c376b 100644 --- a/.github/workflows/mypy_primer_comment.yml +++ b/.github/workflows/mypy_primer_comment.yml @@ -50,9 +50,11 @@ jobs: script: | const fs = require('fs') let data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' }) - // posting comment fails if too long, so truncate - if (data.length > 30000) { - let truncated_data = data.substring(0, 30000) + + // Maximum comment length is 65536 characters. We need much less than 236 for extra text. + const MAX_LENGTH = 65300 + if (data.length > MAX_LENGTH) { + let truncated_data = data.substring(0, MAX_LENGTH) let lines_truncated = data.split('\n').length - truncated_data.split('\n').length data = truncated_data + `\n\n... (truncated ${lines_truncated} lines) ...\n` }