diff --git a/lib/platform/github/index.spec.ts b/lib/platform/github/index.spec.ts index caf929f2a6..505b53e2f9 100644 --- a/lib/platform/github/index.spec.ts +++ b/lib/platform/github/index.spec.ts @@ -640,7 +640,7 @@ describe('platform/github', () => { () => ({ body: { - state: 'failed', + state: 'failure', }, } as any) ); @@ -690,7 +690,7 @@ describe('platform/github', () => { { id: 23950195, status: 'completed', - conclusion: 'failed', + conclusion: 'failure', name: 'Travis CI - Branch', }, ], @@ -796,7 +796,7 @@ describe('platform/github', () => { }, { context: 'context-3', - state: 'failed', + state: 'failure', }, ], } as any) @@ -825,7 +825,7 @@ describe('platform/github', () => { }, { context: 'context-3', - state: 'failed', + state: 'error', }, ], } as any) diff --git a/lib/platform/github/index.ts b/lib/platform/github/index.ts index c408d5c1e1..1fef0446d7 100644 --- a/lib/platform/github/index.ts +++ b/lib/platform/github/index.ts @@ -1057,11 +1057,13 @@ export async function getBranchPr(branchName: string): Promise { return existingPr ? getPr(existingPr.number) : null; } +// https://developer.github.com/v3/repos/statuses +// https://developer.github.com/v3/checks/runs/ type BranchState = 'failure' | 'pending' | 'success'; interface GhBranchStatus { context: string; - state: BranchState; + state: BranchState | 'error'; } interface CombinedBranchStatus { @@ -1156,14 +1158,14 @@ export async function getBranchStatus( if (commitStatus.state === 'success') { return BranchStatus.green; } - if (commitStatus.state === 'failed') { + if (commitStatus.state === 'failure') { return BranchStatus.red; } return BranchStatus.yellow; } if ( - commitStatus.state === 'failed' || - checkRuns.some(run => run.conclusion === 'failed') + commitStatus.state === 'failure' || + checkRuns.some(run => run.conclusion === 'failure') ) { return BranchStatus.red; } @@ -1189,7 +1191,8 @@ async function getStatusCheck( const githubToRenovateStatusMapping = { success: BranchStatus.green, - failed: BranchStatus.red, + error: BranchStatus.red, + failure: BranchStatus.red, pending: BranchStatus.yellow, };