Fix bug always showing 0/n completed checks

This commit is contained in:
Mattias Granlund 2024-05-24 11:39:46 +01:00
parent 867323cfee
commit d9b37ee75b
3 changed files with 8 additions and 3 deletions

View File

@ -132,11 +132,11 @@
function getChecksCount(status: ChecksStatus): string {
if (!status) return 'Running checks';
const completed = status.completed || 0;
const finished = status.finished || 0;
const skipped = status.skipped || 0;
const total = (status.totalCount || 0) - skipped;
return `Checks completed ${completed}/${total}`;
return `Checks completed ${finished}/${total}`;
}
function getChecksTagInfo(

View File

@ -381,6 +381,9 @@ export class GitHubService {
const totalCount = resp?.data.total_count;
const success = queued == 0 && failed == 0 && skipped + succeeded == totalCount;
const finished = checks.filter(
(c) => c.conclusion && ['failure', 'success'].includes(c.conclusion)
).length;
return {
startedAt: firstStart,
@ -389,7 +392,8 @@ export class GitHubService {
completed,
queued,
totalCount,
skipped
skipped,
finished
};
}

View File

@ -64,6 +64,7 @@ export type ChecksStatus =
queued?: number;
totalCount?: number;
skipped?: number;
finished?: number;
}
| null
| undefined;