fix(gitlab): check for unexpected branch statuses (#11669)

This commit is contained in:
Rhys Arkins 2021-09-10 12:39:46 +02:00 committed by GitHub
parent c8ba6d96f2
commit 19b9311037
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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');