Merge pull request #31 from ComposioHQ/fix/ci-status-merged-prs

fix: don't report CI as failing for merged/closed PRs
This commit is contained in:
prateek 2026-02-14 20:20:24 +05:30 committed by GitHub
commit 05e537ca78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 2 deletions

View File

@ -267,8 +267,17 @@ function createGitHubSCM(): SCM {
try {
checks = await this.getCIChecks(pr);
} catch {
// Fail closed: if we can't fetch CI status, report as failing
// rather than "none" (which getMergeability treats as passing).
// Before fail-closing, check if the PR is merged/closed —
// GitHub may not return check data for those, and reporting
// "failing" for a merged PR is wrong.
try {
const state = await this.getPRState(pr);
if (state === "merged" || state === "closed") return "none";
} catch {
// Can't determine state either; fall through to fail-closed.
}
// Fail closed for open PRs: report as failing rather than
// "none" (which getMergeability treats as passing).
return "failing";
}
if (checks.length === 0) return "none";