Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 21, 2025

The ai-moderator workflow was processing issues and pull requests created by system bots (github-actions, copilot), wasting compute and potentially adding incorrect labels to automated content.

Changes

  • Added copilot[bot] to bot exclusion list in ai-moderator workflow's check_external_user job
  • Refactored bot checking from inline conditionals to maintainable array-based lookup
  • Updated compiled workflow lockfile

Implementation

Before:

if (actor.endsWith('[bot]') && (actor === 'github-actions[bot]' || actor === 'github-actions')) {
  // Skip
}

After:

const excludedBots = ['github-actions[bot]', 'github-actions', 'copilot[bot]'];
if (actor.endsWith('[bot]') && excludedBots.includes(actor)) {
  core.info(`⏭️  Skipping workflow - issue opened by bot: ${actor}`);
  core.setOutput('should_run', 'false');
  return;
}

The workflow now correctly skips moderation for all system bot accounts.

Original prompt

ai-moderator should not review issue/pull requests created by the copilot or GitHub action bots.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Updated the bot exclusion list in ai-moderator workflow
- Added copilot[bot] to excludedBots array alongside github-actions[bot]
- Updated check_actor script to use a more maintainable array-based approach
- Recompiled all workflows to ensure consistency

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add restrictions for AI moderator on bot-created issues Exclude copilot and GitHub Actions bots from ai-moderator review Dec 21, 2025
Copilot AI requested a review from pelikhan December 21, 2025 19:32
@pelikhan pelikhan marked this pull request as ready for review December 21, 2025 19:33
@pelikhan pelikhan merged commit 86d02f5 into main Dec 21, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/add-ai-moderator-restrictions branch December 21, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants