Skip to content

Commit

Permalink
always return a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
alexivanov committed Aug 19, 2024
1 parent ffe777f commit 7b7b150
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions out/cloud-compute.entrypoint.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/common/ensure-base-exists.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const ensureBaseTestsExists = async ({
context: Context;
octokit: InstanceType<typeof GitHub>;
getBaseTestRun: (options: { baseSha: string }) => Promise<TestRun | null>;
}): Promise<{ baseTestRunExists: boolean | null }> => {
}): Promise<{ baseTestRunExists: boolean }> => {
const logger = log.getLogger(METICULOUS_LOGGER_NAME);

if (!base) {
Expand Down Expand Up @@ -88,7 +88,7 @@ export const tryTriggerTestsWorkflowOnBase = async ({
base: string;
context: Context;
octokit: InstanceType<typeof GitHub>;
}): Promise<{ baseTestRunExists: boolean | null }> => {
}): Promise<{ baseTestRunExists: boolean }> => {
const { owner, repo } = context.repo;
const { workflowId } = await getCurrentWorkflowId({ context, octokit });

Expand Down Expand Up @@ -137,7 +137,7 @@ export const tryTriggerTestsWorkflowOnBase = async ({

// Running missing tests on base is only supported for Pull Request events
if (event.type !== "pull_request") {
return { baseTestRunExists: null };
return { baseTestRunExists: false };
}

// We can only trigger a workflow_run against the head of the base branch
Expand All @@ -162,7 +162,7 @@ export const tryTriggerTestsWorkflowOnBase = async ({
Therefore no diffs will be reported for this run. Re-running the tests may fix this.`;
logger.warn(message);
ghWarning(message);
return { baseTestRunExists: null };
return { baseTestRunExists: false };
}

const workflowRun = await startNewWorkflowRun({
Expand All @@ -178,7 +178,7 @@ export const tryTriggerTestsWorkflowOnBase = async ({
const message = `Warning: Could not retrieve dispatched workflow run. Will not perform diffs against ${base}.`;
logger.warn(message);
ghWarning(message);
return { baseTestRunExists: null };
return { baseTestRunExists: false };
}

logger.info(`Waiting on workflow run: ${workflowRun.html_url}`);
Expand Down

0 comments on commit 7b7b150

Please sign in to comment.