Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,24 @@ describe("pull request detail decoding", () => {
expect(detail.checksState).toBe("pending");
});

it("reads a check by its conclusion when GitHub never marks it completed", () => {
const detail = detailOf([
inWorkflow({
name: "Changes",
workflowName: "CI",
status: "IN_PROGRESS",
conclusion: "SUCCESS",
startedAt: "2026-11-24T22:26:00Z",
completedAt: "2026-11-24T22:26:06Z",
}),
]);

expect(detail.checks.map((check) => [check.name, check.status])).toEqual([
["Changes", "success"],
]);
expect(detail.checksState).toBe("passing");
});

it("keeps a check pending while another run of it on the same commit is still going", () => {
const finished = {
name: "check",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,9 @@ function hasTeamReviewRequest(raw: ReadonlyArray<ReviewRequestFields> | undefine

function toCheckStatus(raw: CheckFields): PullRequestCheckStatus {
const status = raw.status?.trim().toUpperCase();
if (status !== undefined && status !== "COMPLETED" && status !== "") {
// GitHub can leave a finished check run's status stuck at IN_PROGRESS; its conclusion is final.
const concluded = (raw.conclusion?.trim() ?? "") !== "";
if (!concluded && status !== undefined && status !== "COMPLETED" && status !== "") {
return "pending";
}
switch ((raw.conclusion ?? raw.state)?.trim().toUpperCase()) {
Expand Down
Loading