Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(gitlab): check for unexpected branch statuses (#11669)
  • Loading branch information
rarkins committed Sep 10, 2021
1 parent c8ba6d9 commit 19b9311
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/platform/gitlab/index.ts
Expand Up @@ -389,6 +389,14 @@ export async function getBranchStatus(
}

const branchStatuses = await getStatus(branchName);
// istanbul ignore if
if (!is.array(branchStatuses)) {
logger.warn(
{ branchName, branchStatuses },
'Empty or unexpected branch statuses'
);
return BranchStatus.yellow;
}
logger.debug(`Got res with ${branchStatuses.length} results`);
// ignore all skipped jobs
const res = branchStatuses.filter((check) => check.status !== 'skipped');
Expand Down

0 comments on commit 19b9311

Please sign in to comment.