@@ -45,6 +45,15 @@ const fs = __importStar(__nccwpck_require__(7147));
45
45
const util = __importStar(__nccwpck_require__(3837));
46
46
const utils = __importStar(__nccwpck_require__(918));
47
47
const 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
+ }
48
57
function run() {
49
58
return __awaiter(this, void 0, void 0, function* () {
50
59
try {
@@ -64,9 +73,10 @@ function run() {
64
73
// Check the file exists
65
74
if (yield util.promisify(fs.exists)(inputs.contentFilepath)) {
66
75
// Fetch the file content
67
- const fileContent = yield fs.promises.readFile(inputs.contentFilepath, {
76
+ let fileContent = yield fs.promises.readFile(inputs.contentFilepath, {
68
77
encoding: 'utf8'
69
78
});
79
+ fileContent = truncateBody(fileContent);
70
80
const issueNumber = yield (() => __awaiter(this, void 0, void 0, function* () {
71
81
if (inputs.issueNumber) {
72
82
// Update an existing issue
0 commit comments