From 19b93110374cba0f32aa4e591d066b12780da9cb Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Fri, 10 Sep 2021 12:39:46 +0200 Subject: [PATCH] fix(gitlab): check for unexpected branch statuses (#11669) --- lib/platform/gitlab/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/platform/gitlab/index.ts b/lib/platform/gitlab/index.ts index 6fdbccf4312394..82cac84d0f59ed 100644 --- a/lib/platform/gitlab/index.ts +++ b/lib/platform/gitlab/index.ts @@ -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');