Skip to content

Commit f81af2b

Browse files
authored
Avoid commenting with the PR Draft Nudge if PR creator is a bot (#10)
1 parent fde3342 commit f81af2b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/scripts/pr-draft-nudge.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ module.exports = async ({ github, context, core }) => {
1212
return;
1313
}
1414

15+
// Skip commenting if the PR creator is a bot
16+
if (pr.user.type === "Bot" || pr.user.login.endsWith("[bot]")) {
17+
core.info(`Skipping PR draft nudge for bot user: ${pr.user.login}`);
18+
return;
19+
}
20+
1521
// We only want to comment on PRs that are opened ready for review with reviewers.
1622
const hasIndividualReviewers = pr.requested_reviewers && pr.requested_reviewers.length > 0;
1723
const hasTeamReviewers = pr.requested_teams && pr.requested_teams.length > 0;

0 commit comments

Comments
 (0)