Skip to content

Commit ae1e75a

Browse files
committed
fix: truncate
1 parent 67b51eb commit ae1e75a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

dist/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30792,12 +30792,14 @@ function run() {
3079230792
console.log("Error parsing size-limit output. The output should be a json.");
3079330793
throw error;
3079430794
}
30795-
const body = [
30795+
let body = [
3079630796
SIZE_LIMIT_HEADING,
3079730797
(0, markdown_table_1.default)(limit.formatResults(base, current, {
3079830798
minDelta: minDelta ? Number(minDelta) : 0
3079930799
}))
3080030800
].join("\r\n");
30801+
if (body.length > 65536)
30802+
body = body.substring(0, 65536);
3080130803
const sizeLimitComment = yield fetchPreviousComment(octokit, repo, pr);
3080230804
if (!sizeLimitComment) {
3080330805
try {

src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async function run() {
8282
throw error;
8383
}
8484

85-
const body = [
85+
let body = [
8686
SIZE_LIMIT_HEADING,
8787
table(
8888
limit.formatResults(base, current, {
@@ -91,6 +91,8 @@ async function run() {
9191
)
9292
].join("\r\n");
9393

94+
if (body.length > 65536) body = body.substring(0, 65536);
95+
9496
const sizeLimitComment = await fetchPreviousComment(octokit, repo, pr);
9597

9698
if (!sizeLimitComment) {

0 commit comments

Comments
 (0)