Skip to content

Commit 3c5a904

Browse files
fix(validate-pr): Allow trusted bots and service accounts to bypass validation
Adds an allowlist of trusted bots and service accounts that are exempt from issue reference validation. Prevents dependabot, renovate, and internal release bots from being automatically closed. The allowlist is managed centrally in validate-pr.js — SDK repos pick up changes via SHA bumps. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4243265 commit 3c5a904

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

validate-pr/scripts/validate-pr.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ module.exports = async ({ github, context, core }) => {
1717
const prAuthor = pullRequest.user.login;
1818
const contributingUrl = `https://github.com/${repo.owner}/${repo.repo}/blob/${context.payload.repository.default_branch}/CONTRIBUTING.md`;
1919

20+
// --- Step 0: Skip allowed bots and service accounts ---
21+
const ALLOWED_BOTS = [
22+
'codecov-ai[bot]',
23+
'dependabot[bot]',
24+
'fix-it-felix-sentry[bot]',
25+
'getsentry-bot',
26+
'github-actions[bot]',
27+
'javascript-sdk-gitflow[bot]',
28+
'renovate[bot]',
29+
];
30+
if (ALLOWED_BOTS.includes(prAuthor)) {
31+
core.info(`PR author ${prAuthor} is an allowed bot. Skipping validation.`);
32+
return;
33+
}
34+
2035
// --- Helper: check if a user has admin or maintain permission on a repo (cached) ---
2136
const maintainerCache = new Map();
2237
async function isMaintainer(owner, repoName, username) {

0 commit comments

Comments
 (0)