@@ -45,6 +45,15 @@ const fs = __importStar(__nccwpck_require__(7147));
4545const util = __importStar(__nccwpck_require__(3837));
4646const utils = __importStar(__nccwpck_require__(918));
4747const util_1 = __nccwpck_require__(3837);
48+ function truncateBody(body) {
49+ // 65536 characters is the maximum allowed for issues.
50+ const truncateWarning = '...*[Issue body truncated]*';
51+ if (body.length > 65536) {
52+ core.warning(`Issue body is too long. Truncating to 65536 characters.`);
53+ return body.substring(0, 65536 - truncateWarning.length) + truncateWarning;
54+ }
55+ return body;
56+ }
4857function run() {
4958 return __awaiter(this, void 0, void 0, function* () {
5059 try {
@@ -64,9 +73,10 @@ function run() {
6473 // Check the file exists
6574 if (yield util.promisify(fs.exists)(inputs.contentFilepath)) {
6675 // Fetch the file content
67- const fileContent = yield fs.promises.readFile(inputs.contentFilepath, {
76+ let fileContent = yield fs.promises.readFile(inputs.contentFilepath, {
6877 encoding: 'utf8'
6978 });
79+ fileContent = truncateBody(fileContent);
7080 const issueNumber = yield (() => __awaiter(this, void 0, void 0, function* () {
7181 if (inputs.issueNumber) {
7282 // Update an existing issue
0 commit comments