Skip to content

Commit ea9937c

Browse files
authored
Fix/action (#21)
* debug * remove console logs
1 parent 6e8833e commit ea9937c

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

build/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4000,7 +4000,6 @@ async function execCommand(command, args, options = {}, logError = true) {
40004000
}
40014001
}
40024002
async function runAction(opticToken, githubToken, { additionalArgs, standardsFail, eventName, headRef, baseRef, owner, repo, sha, refName, compareFromPush, compareFromPr, }) {
4003-
var _a;
40044003
const failOnCheckError = standardsFail === "true";
40054004
const valid = verifyInput(opticToken, eventName, owner, repo);
40064005
if (!valid) {
@@ -4021,7 +4020,7 @@ async function runAction(opticToken, githubToken, { additionalArgs, standardsFai
40214020
}
40224021
let from = "";
40234022
if (eventName === "pull_request") {
4024-
const fromBranch = (_a = compareFromPr !== null && compareFromPr !== void 0 ? compareFromPr : baseRef) !== null && _a !== void 0 ? _a : "";
4023+
const fromBranch = compareFromPr || baseRef || "";
40254024
const ref = await parseAndEnsureRef(fromBranch);
40264025
if (!ref) {
40274026
core.error(`Unable to fetch ${from}`);
@@ -4030,7 +4029,7 @@ async function runAction(opticToken, githubToken, { additionalArgs, standardsFai
40304029
from = ref;
40314030
}
40324031
else if (eventName === "push") {
4033-
const fromBranch = compareFromPush !== null && compareFromPush !== void 0 ? compareFromPush : "HEAD~1";
4032+
const fromBranch = compareFromPush || "HEAD~1";
40344033
const ref = await parseAndEnsureRef(fromBranch);
40354034
if (!ref) {
40364035
core.error(`Unable to fetch ${from}`);

src/action.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export async function runAction(
7373

7474
let from = "";
7575
if (eventName === "pull_request") {
76-
const fromBranch = compareFromPr ?? baseRef ?? "";
76+
const fromBranch = compareFromPr || baseRef || "";
7777
const ref = await parseAndEnsureRef(fromBranch);
7878

7979
if (!ref) {
@@ -82,7 +82,7 @@ export async function runAction(
8282
}
8383
from = ref;
8484
} else if (eventName === "push") {
85-
const fromBranch = compareFromPush ?? "HEAD~1";
85+
const fromBranch = compareFromPush || "HEAD~1";
8686
const ref = await parseAndEnsureRef(fromBranch);
8787

8888
if (!ref) {

0 commit comments

Comments
 (0)