We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 339a7b6 commit eea524aCopy full SHA for eea524a
src/github/operations/pulls.ts
@@ -149,12 +149,15 @@ async function checkForExistingPullRequest(
149
const existingPRs = await listPullRequests({
150
owner,
151
repo,
152
- head,
153
- base,
154
state: "open",
155
});
156
157
- if (existingPRs.length > 0) {
+ // Check if any existing open PR has the exact same head and base combination
+ const duplicatePR = existingPRs.find(pr =>
+ pr.head.ref === head && pr.base.ref === base
158
+ );
159
+
160
+ if (duplicatePR) {
161
throw new GitHubConflictError(
162
`A pull request already exists for ${head} into ${base}`
163
);
0 commit comments