Skip to content

Commit 90fac26

Browse files
tbriskerares
authored andcommitted
Correctly calculate needs_rebase
From GH API doc: The value of the mergeable attribute can be true, false, or null. If the value is null, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-null value for the mergeable attribute in the response.
1 parent 4d7b243 commit 90fac26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

github_pr.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def closed?
6060
end
6161

6262
def mergeable?
63-
@attrs.fetch('mergeable')
63+
# Github returns null for mergable while it's calculating mergability, treat PRs as mergable until proven otherwise
64+
@attrs.fetch('mergeable') || @attrs.fetch('mergeable').nil?
6465
end
6566

6667
def merged?

0 commit comments

Comments
 (0)