Skip to content

Commit 4abd6da

Browse files
committed
fix: statusCheckRollup nullable
1 parent 96d576e commit 4abd6da

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export interface IssueInfo {
8181

8282
export interface CommitInfo {
8383
commit: {
84-
statusCheckRollup: StatusCheckRollupInfo
84+
statusCheckRollup?: StatusCheckRollupInfo
8585
}
8686
}
8787

src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export function isPendingMergePr(
66
condition: Condition
77
): boolean {
88
const check = pr.commits.nodes[0].commit.statusCheckRollup
9+
if (!check) return false
910
const checkNodes = check.contexts.nodes
1011
return (
1112
isSatisfyBasicConditionPr(pr, condition) &&
@@ -52,6 +53,7 @@ function isStatusChecksSuccess(
5253
condition: Condition
5354
): boolean {
5455
const check = pr.commits.nodes[0].commit.statusCheckRollup
56+
if (!check) return false
5557
if (condition.requiredStatusChecks.length) {
5658
const nodeChecks = new Map(
5759
check.contexts.nodes.map(i => [i.name || i.context, i])

0 commit comments

Comments
 (0)