Skip to content
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
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