Skip to content

Commit cae6421

Browse files
authored
Merge pull request #244 from lcdsmao/fix-contexts-null
fix: contexts null
2 parents dffcd20 + 7919e25 commit cae6421

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

dist/index.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "update-branch",
3-
"version": "3.1.3",
3+
"version": "3.1.4",
44
"private": true,
55
"description": "Merge your pull request in order.",
66
"main": "lib/main.js",

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)