Retrieve the normalized PullRequestStatus for the provided github check state.
( conclusion: CheckConclusionState | null, status: CheckStatusState, )
| 282 | |
| 283 | /** Retrieve the normalized PullRequestStatus for the provided github check state. */ |
| 284 | function normalizeGithubCheckState( |
| 285 | conclusion: CheckConclusionState | null, |
| 286 | status: CheckStatusState, |
| 287 | ): PullRequestStatus { |
| 288 | if (status !== 'COMPLETED') { |
| 289 | return PullRequestStatus.PENDING; |
| 290 | } |
| 291 | |
| 292 | // If the `status` is completed, a conclusion is guaranteed to be set. |
| 293 | switch (conclusion!) { |
| 294 | case 'ACTION_REQUIRED': |
| 295 | case 'TIMED_OUT': |
| 296 | case 'CANCELLED': |
| 297 | case 'FAILURE': |
| 298 | case 'SKIPPED': |
| 299 | case 'STALE': |
| 300 | case 'STARTUP_FAILURE': |
| 301 | return PullRequestStatus.FAILING; |
| 302 | case 'SUCCESS': |
| 303 | case 'NEUTRAL': |
| 304 | return PullRequestStatus.PASSING; |
| 305 | } |
| 306 | } |
no outgoing calls
no test coverage detected