Skip to content

Commit e81268f

Browse files
authored
ci: fix logic in check-is-mergeable check (#8152)
1 parent a3f199f commit e81268f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/pr_check.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
140140
let i = 0;
141141
142-
while (pr.mergeable == null || i >= 60) {
142+
while (pr.mergeable == null && i < 60) {
143143
console.log("get pull-request status");
144144
145145
let result = await github.rest.pulls.get({
@@ -158,6 +158,11 @@ jobs:
158158

159159
console.log("pr.mergeable=%o", pr.mergeable);
160160

161+
if (pr.mergeable === null) {
162+
core.setFailed("Unable to check if the PR is mergeable, please re-run the check.");
163+
return false;
164+
}
165+
161166
const { data: comments } = await github.rest.issues.listComments({
162167
issue_number: context.issue.number,
163168
owner: context.repo.owner,
@@ -166,7 +171,7 @@ jobs:
166171

167172
const commentToUpdate = comments.find(comment => comment.body.startsWith(header));
168173

169-
if (pr.mergeable === false) {
174+
if (!pr.mergeable) {
170175
let commentParams = {
171176
...context.repo,
172177
issue_number: context.issue.number,

0 commit comments

Comments
 (0)