From bd4483cb836a0d42dd68ba099237b6e00985cfd5 Mon Sep 17 00:00:00 2001 From: amio Date: Wed, 21 Aug 2019 22:31:10 +0800 Subject: [PATCH] (github-badge) fix action status for unmatched context. fix #305 --- endpoints/github.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/endpoints/github.ts b/endpoints/github.ts index 63fa51e..4a52752 100644 --- a/endpoints/github.ts +++ b/endpoints/github.ts @@ -107,10 +107,12 @@ const statesColor = { pending: 'orange', success: 'green', failure: 'red', - error: 'red' + error: 'red', + unknown: 'grey' } -function combineState (states) { +function combineState (states: Array) { + if (states.length === 0) return 'unknown' if (states.find(x => x.state === 'error')) return 'error' if (states.find(x => x.state === 'failure')) return 'failure' if (states.find(x => x.state === 'pending')) return 'pending'