Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/helpers/pullRequestProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ export async function processPullRequests() {
console.log(`Found ${pullRequests.length} pull requests`);

for (const pullRequest of pullRequests) {
// Skip draft PRs - they cannot be merged and should not be processed
if (pullRequest.draft) {
console.log(
`⏸️ Skipping draft PR #${pullRequest.number}: ${pullRequest.title}`
);
continue;
}

const prResult = {
number: pullRequest.number,
title: pullRequest.title,
Expand Down Expand Up @@ -303,6 +311,11 @@ export async function processRepositoryPullRequests(owner, repo) {
const results = [];

for (const pullRequest of pullRequests) {
// Skip draft PRs
if (pullRequest.draft) {
continue;
}

const pullRequestData = await getPullRequestData(
githubClient,
owner,
Expand Down
16 changes: 16 additions & 0 deletions src/helpers/webhookHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ export async function handlePullRequestWebhook(data) {
return { error: 'No GitHub App configured' };
}

// Skip draft PRs - they cannot be merged and should not be processed
if (pullRequest.draft) {
console.log(
`⏸️ Skipping draft PR #${pullRequest.number}: ${pullRequest.title}`
);
return { info: 'Draft PR skipped' };
}

try {
const installationId = dbRepository.installationId;

Expand Down Expand Up @@ -204,6 +212,14 @@ export async function handlePullRequestReviewWebhook(data) {
return { error: 'No GitHub App configured' };
}

// Skip draft PRs
if (pullRequest.draft) {
console.log(
`⏸️ Skipping review for draft PR #${pullRequest.number}: ${pullRequest.title}`
);
return { info: 'Draft PR review skipped' };
}

try {
const installationId = dbRepository.installationId;

Expand Down