Skip to content

CI Comment and label new PRs and issues with AgentScan results - #35472

Open
cakedev0 wants to merge 6 commits into
scikit-learn:mainfrom
cakedev0:agentscan-comment
Open

cakedev0 wants to merge 6 commits into
scikit-learn:mainfrom
cakedev0:agentscan-comment

Conversation

@cakedev0

@cakedev0 cakedev0 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Reference Issues/PRs

Towards #35173 (the "Add profile information to issue/PRs automatically" section, where there is rough consensus on starting with AgentScan).

What does this implement/fix? Explain your changes.

Adds a workflow that runs the AgentScan action when a PR is opened or reopened, or an issue is opened. It uses mode: full:

  • a comment with the classification, a link to the AgentScan analysis of the author, and the evidence in a collapsed section. This is the useful part: the link is there, no need to go and scan the user by hand.
  • a label (agentscan:mixed-signals, agentscan:automated-account or agentscan:community-flagged). Less useful, but it could help to filter or bulk-close PRs later.

Nothing is posted when the activity looks organic (the action's default). Accounts with too little public activity get a short "Insufficient data" comment (two lines and the link, no label). Org members and authors with at least 10 merged PRs are skipped by a first step. It checks the membership with BOT_GITHUB_READ_ORG_TOKEN, because the author association of the event doesn't report members with a private membership (same problem as in #35369).

To get an idea of the noise, I ran the action locally in mode: silent (nothing posted) on the 74 non-member authors of the last 200 PRs and issues:

classification authors posted
organic 39 nothing
automation 16 comment + label
mixed 8 comment + label
insufficient data 11 short comment

I replaced the default description line of the comment to say it's a heuristic and to link to our Automated Contributions Policy, similarly to what Node.js does.

pull_request_target is needed to get a write token on PRs from forks. It's safe here because the workflow never checks out the PR code (same as autoclose-comment.yml).

AI usage disclosure

I used AI assistance for:

  • Code generation
  • Research and understanding (reading the action's source to check what the comment looks like)

Any other comments?

I couldn't test the workflow itself on my fork. The local run above only covers the action with these inputs, not the posting nor the membership step with the bot's token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cakedev0 and others added 2 commits November 20, 2026 10:44
Also don't fail the check when the scan fails, and add a concurrency
group and a timeout like in the other labeler workflows.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions github-actions Bot added size/M and removed size/S labels Nov 20, 2026
cakedev0 and others added 2 commits November 20, 2026 16:00
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@cakedev0 cakedev0 changed the title [WIP] CI Comment and label new PRs and issues with AgentScan results CI Comment and label new PRs and issues with AgentScan results Nov 20, 2026
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@cakedev0
cakedev0 marked this pull request as ready for review November 20, 2026 15:26

@lesteve lesteve left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Looking at nodejs/node#67459 (comment) as inspiration, it would be nice to:

  • add a link to https://agentscan.tools/user/<author> so that a maintainer can have a more detailed look
  • use markdown alerts to make it more obvious mixed activity => orange, automated => red
  • comment wording tweaks that I need to think more about, in particular something like vite vitejs/vite#24119 (comment) to say something like "if you believed this is a mistake reply with some details explaining why"

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants