Reapply "BCR reviewer: skip draft PRs (#1929)"
This reverts commit 4e103c2e6b8455d5c0137d5ae1526063f8920568.
The original commit was accidentally reverted while dealing with another
CI issue.
diff --git a/actions/bcr-pr-reviewer/index.js b/actions/bcr-pr-reviewer/index.js
index d468c2a..4339356 100644
--- a/actions/bcr-pr-reviewer/index.js
+++ b/actions/bcr-pr-reviewer/index.js
@@ -222,10 +222,21 @@
}
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(', ')}`);