From 3271a5423145f172b3cef78e46ab4e0624c60781 Mon Sep 17 00:00:00 2001 From: Nicholas Lim <18374483+niclim@users.noreply.github.com> Date: Mon, 1 May 2023 11:00:32 -0400 Subject: [PATCH 1/2] debug --- build/index.js | 7 ++++--- src/action.ts | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/index.js b/build/index.js index b38ca66..1ffe040 100644 --- a/build/index.js +++ b/build/index.js @@ -4000,7 +4000,6 @@ async function execCommand(command, args, options = {}, logError = true) { } } async function runAction(opticToken, githubToken, { additionalArgs, standardsFail, eventName, headRef, baseRef, owner, repo, sha, refName, compareFromPush, compareFromPr, }) { - var _a; const failOnCheckError = standardsFail === "true"; const valid = verifyInput(opticToken, eventName, owner, repo); if (!valid) { @@ -4021,7 +4020,8 @@ async function runAction(opticToken, githubToken, { additionalArgs, standardsFai } let from = ""; if (eventName === "pull_request") { - const fromBranch = (_a = compareFromPr !== null && compareFromPr !== void 0 ? compareFromPr : baseRef) !== null && _a !== void 0 ? _a : ""; + console.log(compareFromPr, baseRef); + const fromBranch = compareFromPr || baseRef || ""; const ref = await parseAndEnsureRef(fromBranch); if (!ref) { core.error(`Unable to fetch ${from}`); @@ -4030,7 +4030,8 @@ async function runAction(opticToken, githubToken, { additionalArgs, standardsFai from = ref; } else if (eventName === "push") { - const fromBranch = compareFromPush !== null && compareFromPush !== void 0 ? compareFromPush : "HEAD~1"; + console.log(compareFromPush); + const fromBranch = compareFromPush || "HEAD~1"; const ref = await parseAndEnsureRef(fromBranch); if (!ref) { core.error(`Unable to fetch ${from}`); diff --git a/src/action.ts b/src/action.ts index b3e0b91..788d8a5 100644 --- a/src/action.ts +++ b/src/action.ts @@ -73,7 +73,8 @@ export async function runAction( let from = ""; if (eventName === "pull_request") { - const fromBranch = compareFromPr ?? baseRef ?? ""; + console.log(compareFromPr, baseRef); + const fromBranch = compareFromPr || baseRef || ""; const ref = await parseAndEnsureRef(fromBranch); if (!ref) { @@ -82,7 +83,8 @@ export async function runAction( } from = ref; } else if (eventName === "push") { - const fromBranch = compareFromPush ?? "HEAD~1"; + console.log(compareFromPush); + const fromBranch = compareFromPush || "HEAD~1"; const ref = await parseAndEnsureRef(fromBranch); if (!ref) { From 74b36c1c47b3c9fed08ad410304d6bf33fd45755 Mon Sep 17 00:00:00 2001 From: Nicholas Lim <18374483+niclim@users.noreply.github.com> Date: Mon, 1 May 2023 11:08:28 -0400 Subject: [PATCH 2/2] remove console logs --- build/index.js | 2 -- src/action.ts | 2 -- 2 files changed, 4 deletions(-) diff --git a/build/index.js b/build/index.js index 1ffe040..46041be 100644 --- a/build/index.js +++ b/build/index.js @@ -4020,7 +4020,6 @@ async function runAction(opticToken, githubToken, { additionalArgs, standardsFai } let from = ""; if (eventName === "pull_request") { - console.log(compareFromPr, baseRef); const fromBranch = compareFromPr || baseRef || ""; const ref = await parseAndEnsureRef(fromBranch); if (!ref) { @@ -4030,7 +4029,6 @@ async function runAction(opticToken, githubToken, { additionalArgs, standardsFai from = ref; } else if (eventName === "push") { - console.log(compareFromPush); const fromBranch = compareFromPush || "HEAD~1"; const ref = await parseAndEnsureRef(fromBranch); if (!ref) { diff --git a/src/action.ts b/src/action.ts index 788d8a5..1f4a6a4 100644 --- a/src/action.ts +++ b/src/action.ts @@ -73,7 +73,6 @@ export async function runAction( let from = ""; if (eventName === "pull_request") { - console.log(compareFromPr, baseRef); const fromBranch = compareFromPr || baseRef || ""; const ref = await parseAndEnsureRef(fromBranch); @@ -83,7 +82,6 @@ export async function runAction( } from = ref; } else if (eventName === "push") { - console.log(compareFromPush); const fromBranch = compareFromPush || "HEAD~1"; const ref = await parseAndEnsureRef(fromBranch);