Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

fix: Pass skipStep on main branch #7

Merged
merged 2 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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), {
Expand Down
11 changes: 6 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function run() {
if (isMainBranch) {
let base;
const { output: baseOutput } = await term.execSizeLimit(
null,
skipStep,
buildScript,
cleanScript,
windowsVerbatimArguments,
Expand Down Expand Up @@ -137,19 +137,20 @@ 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 = [
SIZE_LIMIT_HEADING,
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({
Expand Down