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
2 changes: 2 additions & 0 deletions validate-pr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ runs:
- name: Convert PR to draft
if: >-
steps.validate.outputs.was-closed != 'true'
&& steps.validate.outputs.skipped != 'true'
&& github.event.pull_request.draft == false
shell: bash
env:
Expand All @@ -47,6 +48,7 @@ runs:
- name: Label and comment on draft conversion
if: >-
steps.validate.outputs.was-closed != 'true'
&& steps.validate.outputs.skipped != 'true'
&& github.event.pull_request.draft == false
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
Expand Down
16 changes: 16 additions & 0 deletions validate-pr/scripts/validate-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ module.exports = async ({ github, context, core }) => {
const prAuthor = pullRequest.user.login;
const contributingUrl = `https://github.com/${repo.owner}/${repo.repo}/blob/${context.payload.repository.default_branch}/CONTRIBUTING.md`;

// --- Step 0: Skip allowed bots and service accounts ---
const ALLOWED_BOTS = [
'codecov-ai[bot]',
'dependabot[bot]',
'fix-it-felix-sentry[bot]',
'getsentry-bot',
'github-actions[bot]',
'javascript-sdk-gitflow[bot]',
'renovate[bot]',
];
if (ALLOWED_BOTS.includes(prAuthor)) {
core.info(`PR author ${prAuthor} is an allowed bot. Skipping.`);
core.setOutput('skipped', 'true');
return;
}

// --- Helper: check if a user has admin or maintain permission on a repo (cached) ---
const maintainerCache = new Map();
async function isMaintainer(owner, repoName, username) {
Expand Down
Loading