Skip to content

Commit

Permalink
BCR reviewer: skip draft PRs (#1929)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteorcloudy committed Mar 26, 2024
1 parent 620545f commit 0f29d42
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion actions/bcr-pr-reviewer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,21 @@ async function checkIfAllModifiedModulesApproved(modifiedModules, maintainersMap
}

async function reviewPR(octokit, owner, repo, prNumber) {

console.log('\n');
console.log(`Processing PR #${prNumber}`);

// Skip if the PR is a draft
const prInfo = await octokit.rest.pulls.get({
owner,
repo,
pull_number: prNumber,
});

if (prInfo.data.draft) {
console.log('Skipping draft PR');
return;
}

// Fetch modified modules
const modifiedModules = await fetchAllModifiedModules(octokit, owner, repo, prNumber);
console.log(`Modified modules: ${Array.from(modifiedModules).join(', ')}`);
Expand Down

0 comments on commit 0f29d42

Please sign in to comment.