Skip to content

Commit a61d4d7

Browse files
avwu99Austin Wu
andauthored
fix(check-merge-safety): fix bug when there are multiple merge safety checks running on PRs (#782)
Co-authored-by: Austin Wu <auwu@expediagroup.com>
1 parent 5a4c24c commit a61d4d7

4 files changed

Lines changed: 39 additions & 15 deletions

File tree

dist/helpers/check-merge-safety.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,8 @@ var checkForExistingFailureStatus = async (pullRequest, context2) => {
9191
...context.repo,
9292
ref: pullRequest.head.sha
9393
});
94-
if (data.state === "failure") {
95-
const existingContext = data.statuses.find((status) => status.context === context2);
96-
return Boolean(existingContext);
97-
}
98-
return false;
94+
const existingContext = data.statuses.find((status) => status.context === context2);
95+
return existingContext?.state === "failure";
9996
};
10097
var fetchSha = async (repoUrl, sha) => {
10198
try {
@@ -259,4 +256,4 @@ export {
259256
CheckMergeSafety
260257
};
261258

262-
//# debugId=41C4FA0898BE964F64756E2164756E21
259+
//# debugId=7687825B6B00F97364756E2164756E21

0 commit comments

Comments
 (0)