GitHub action that analyzes PR and issue authors’ recent activity patterns to detect automation signals.
Create a workflow file in your repository (e.g., .github/workflows/agentscan.yml):
name: AgentScan
on:
pull_request_target:
types:
- opened
- reopened
issues:
types:
- opened
jobs:
agentscan:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
contents: read
steps:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@f41545309db947a68e22ed2643f182e754f4d41a
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
The action will run automatically on new and reopened pull requests, and on newly opened issues, analyzing the author’s activity patterns to detect automation signals.
.agentscan-cache). When provided, analysis results are cached and reused within the TTL periodagentscan:community-flagged)agentscan:mixed-signals)agentscan:automated-account)To skip specific team members from being scanned, add their usernames to the skip-members input:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@f41545309db947a68e22ed2643f182e754f4d41a
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-members: "dependabot,renovate,my-trusted-bot"
Members in the skip list will be excluded from analysis without any PR comment or labels added.
To enable caching and avoid redundant API calls, use actions/cache@v5 and pass the cache path to the action:
steps:
- name: Cache AgentScan analysis
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
with:
path: .agentscan-cache
key: agentscan-cache-${{ github.actor }}
restore-keys: agentscan-cache-
- name: AgentScan
uses: MatteoGabriele/agentscan-action@f41545309db947a68e22ed2643f182e754f4d41a
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
cache-path: ".agentscan-cache"
How caching works:
actions/cache with a path and unique keycache-path inputactions/cache persists the directory between workflow runsCache Invalidation: Cached entries automatically expire after 2 days.
To skip posting a PR or issue comment when the analysis result is “organic” (clean, human-like activity), enable the skip-comment-on-organic option:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@f41545309db947a68e22ed2643f182e754f4d41a
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-comment-on-organic: true
When enabled, the action will still output all analysis data (for downstream steps to use) but won’t post a comment on the PR or issue if the account is classified as organic.
To customize labels added to PRs and issues, set any of the label inputs:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@f41545309db947a68e22ed2643f182e754f4d41a
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
label-community-flagged: "security:community-flagged"
label-mixed: "needs-review:automation-signals"
label-automation: "blocked:automated-account"
To disable all PR and issue comments and only use the action’s outputs, set agent-scan-comment to false:
- name: AgentScan
uses: MatteoGabriele/agentscan-action@f41545309db947a68e22ed2643f182e754f4d41a
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
agent-scan-comment: false
This is useful if you want to use the analysis outputs in downstream steps without posting comments.
Run tests with vitest:
pnpm run test
Tests cover the following scenarios:
Stay safe out there, fellow human, and use AI responsibly.