From f19ad5c0b3b5c479aec76f5a66ca8de66d062a9a Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 19 Jan 2023 15:52:38 +0100 Subject: [PATCH 1/2] fix: Pass skipStep on main branch --- dist/index.js | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 3a9d5eb..1094d91 100644 --- a/dist/index.js +++ b/dist/index.js @@ -21943,7 +21943,7 @@ function run() { const resultsFilePath = path_1.default.resolve(__dirname, RESULTS_FILE); if (isMainBranch) { let base; - const { output: baseOutput } = yield term.execSizeLimit(null, buildScript, cleanScript, windowsVerbatimArguments, directory); + const { output: baseOutput } = yield term.execSizeLimit(skipStep, buildScript, cleanScript, windowsVerbatimArguments, directory); try { base = limit.parseResults(baseOutput); } diff --git a/src/main.ts b/src/main.ts index 588f2c4..e082d56 100644 --- a/src/main.ts +++ b/src/main.ts @@ -66,7 +66,7 @@ async function run() { if (isMainBranch) { let base; const { output: baseOutput } = await term.execSizeLimit( - null, + skipStep, buildScript, cleanScript, windowsVerbatimArguments, From 6d231fb4aeb6dc50829d7d31d54a9f4fed2962f0 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 20 Jan 2023 09:54:12 +0100 Subject: [PATCH 2/2] Always update comment if one already exists --- dist/index.js | 7 ++++--- src/main.ts | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dist/index.js b/dist/index.js index 1094d91..7d1cfee 100644 --- a/dist/index.js +++ b/dist/index.js @@ -21986,15 +21986,16 @@ function run() { throw error; } const thresholdNumber = Number(threshold); + // @ts-ignore + const sizeLimitComment = yield fetchPreviousComment(octokit, repo, pr); const shouldComment = isNaN(thresholdNumber) || - limit.hasSizeChanges(base, current, thresholdNumber); + limit.hasSizeChanges(base, current, thresholdNumber) || + sizeLimitComment; if (shouldComment) { const body = [ SIZE_LIMIT_HEADING, (0, markdown_table_1.markdownTable)(limit.formatResults(base, current)), ].join("\r\n"); - // @ts-ignore - const sizeLimitComment = yield fetchPreviousComment(octokit, repo, pr); try { if (!sizeLimitComment) { yield octokit.rest.issues.createComment(Object.assign(Object.assign({}, repo), { diff --git a/src/main.ts b/src/main.ts index e082d56..19a3e24 100644 --- a/src/main.ts +++ b/src/main.ts @@ -137,9 +137,13 @@ async function run() { const thresholdNumber = Number(threshold); + // @ts-ignore + const sizeLimitComment = await fetchPreviousComment(octokit, repo, pr); + const shouldComment = isNaN(thresholdNumber) || - limit.hasSizeChanges(base, current, thresholdNumber); + limit.hasSizeChanges(base, current, thresholdNumber) || + sizeLimitComment; if (shouldComment) { const body = [ @@ -147,9 +151,6 @@ async function run() { markdownTable(limit.formatResults(base, current)), ].join("\r\n"); - // @ts-ignore - const sizeLimitComment = await fetchPreviousComment(octokit, repo, pr); - try { if (!sizeLimitComment) { await octokit.rest.issues.createComment({