Merge pull request #3336 from cli/pr-checks-crash
Treat unrecognized PR Checks statuses as "pending"
This commit is contained in:
commit
df5883186c
2 changed files with 2 additions and 6 deletions
|
|
@ -188,10 +188,8 @@ func (pr *PullRequest) ChecksStatus() (summary PullRequestChecksStatus) {
|
|||
summary.Passing++
|
||||
case "ERROR", "FAILURE", "CANCELLED", "TIMED_OUT", "ACTION_REQUIRED":
|
||||
summary.Failing++
|
||||
case "EXPECTED", "REQUESTED", "QUEUED", "PENDING", "IN_PROGRESS", "STALE":
|
||||
default: // "EXPECTED", "REQUESTED", "WAITING", "QUEUED", "PENDING", "IN_PROGRESS", "STALE"
|
||||
summary.Pending++
|
||||
default:
|
||||
panic(fmt.Errorf("unsupported status: %q", state))
|
||||
}
|
||||
summary.Total++
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,13 +141,11 @@ func checksRun(opts *ChecksOptions) error {
|
|||
markColor = cs.Red
|
||||
failing++
|
||||
bucket = "fail"
|
||||
case "EXPECTED", "REQUESTED", "QUEUED", "PENDING", "IN_PROGRESS", "STALE":
|
||||
default: // "EXPECTED", "REQUESTED", "WAITING", "QUEUED", "PENDING", "IN_PROGRESS", "STALE"
|
||||
mark = "-"
|
||||
markColor = cs.Yellow
|
||||
pending++
|
||||
bucket = "pending"
|
||||
default:
|
||||
panic(fmt.Errorf("unsupported status: %q", state))
|
||||
}
|
||||
|
||||
elapsed := ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue