@@ -76,11 +76,12 @@ export function checkStatus(check: PullRequestCheck) {
7676}
7777
7878export function pullRequestChecksSummary ( pr : Pick < PullRequestDetail , "checks" > ) {
79+ const total = pr . checks . filter ( ( check ) => check . status !== "skipped" ) . length ;
7980 const failed = pr . checks . filter ( ( check ) => check . status === "failure" ) . length ;
8081 const required = pr . checks . filter ( ( check ) => check . status === "action-required" ) . length ;
8182 const pending = pr . checks . filter ( ( check ) => check . status === "pending" ) . length ;
8283 const passed = pr . checks . filter ( ( check ) => check . status === "success" ) . length ;
83- const count = pr . checks . length ? `${ passed } of ${ pr . checks . length } ` : undefined ;
84+ const count = total ? `${ passed } of ${ total } ` : undefined ;
8485 if ( failed )
8586 return {
8687 label : `${ failed } ${ failed === 1 ? "check" : "checks" } failing` ,
@@ -107,15 +108,20 @@ export function pullRequestChecksSummary(pr: Pick<PullRequestDetail, "checks">)
107108 } as const ;
108109 if ( passed )
109110 return {
110- label : `${ passed } of ${ pr . checks . length } passed` ,
111- title : passed === pr . checks . length ? "All checks passed" : "Checks completed" ,
111+ label : `${ passed } of ${ total } passed` ,
112+ title : passed === total ? "All checks passed" : "Checks completed" ,
112113 count,
113114 icon : "checkmark.circle" ,
114115 tint : "accent-adaptive-emerald-600-400" ,
115116 } as const ;
117+ const title = ! pr . checks . length
118+ ? "No checks reported"
119+ : total === 0
120+ ? "All checks skipped"
121+ : "Checks completed" ;
116122 return {
117- label : pr . checks . length ? `${ pr . checks . length } completed` : "No checks reported" ,
118- title : pr . checks . length ? "Checks completed" : "No checks reported" ,
123+ label : total ? `${ pr . checks . length } completed` : title ,
124+ title,
119125 count,
120126 icon : "minus" ,
121127 tint : "accent-icon-muted" ,
0 commit comments