Skip to content

Commit

Permalink
Fix/action (#21)
Browse files Browse the repository at this point in the history
* debug

* remove console logs
  • Loading branch information
niclim authored May 1, 2023
1 parent 6e8833e commit ea9937c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -4021,7 +4020,7 @@ 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 : "";
const fromBranch = compareFromPr || baseRef || "";
const ref = await parseAndEnsureRef(fromBranch);
if (!ref) {
core.error(`Unable to fetch ${from}`);
Expand All @@ -4030,7 +4029,7 @@ async function runAction(opticToken, githubToken, { additionalArgs, standardsFai
from = ref;
}
else if (eventName === "push") {
const fromBranch = compareFromPush !== null && compareFromPush !== void 0 ? compareFromPush : "HEAD~1";
const fromBranch = compareFromPush || "HEAD~1";
const ref = await parseAndEnsureRef(fromBranch);
if (!ref) {
core.error(`Unable to fetch ${from}`);
Expand Down
4 changes: 2 additions & 2 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function runAction(

let from = "";
if (eventName === "pull_request") {
const fromBranch = compareFromPr ?? baseRef ?? "";
const fromBranch = compareFromPr || baseRef || "";
const ref = await parseAndEnsureRef(fromBranch);

if (!ref) {
Expand All @@ -82,7 +82,7 @@ export async function runAction(
}
from = ref;
} else if (eventName === "push") {
const fromBranch = compareFromPush ?? "HEAD~1";
const fromBranch = compareFromPush || "HEAD~1";
const ref = await parseAndEnsureRef(fromBranch);

if (!ref) {
Expand Down

0 comments on commit ea9937c

Please sign in to comment.